Skip to content

方法事件 ​

注意

方法事件为组件方法调用后异步回调事件

用法示例 ​

js
//事件
onEventMethod(e) {
  console.log(e.detail)
}
js
function onEventMethod(e : JSONObject) {
  console.log("onEvent:" + e.toJSONString())
}

回调示例 ​

json
{
    "type": "startLocalPreview",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "updateLocalView",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "stopLocalPreview",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "startRemoteView",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "updateRemoteView",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "stopRemoteView",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "stopAllRemoteView",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "initMeiHuBeauty",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "showMeiHuBeauty",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "hideMeiHuBeauty",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "meiHuBeautyIsShow",
    "data": {
        "data": {
            "result":true
        },
        "message": "",
        "code": 0
    }
}

回调说明 ​

参数名参数类型参数描述
typeString事件类型,请参考下方说明
dataObject事件数据
data.codeInteger事件结果类型,0.成功,其他:失败
data.dataInteger事件结果数据
data.messageString事件结果消息

回调事件类型说明 ​

开启本地摄像头的预览画面 ​

类型名称 ​

startLocalPreview

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

更新本地摄像头的预览画面 ​

类型名称 ​

updateLocalView

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

停止摄像头预览 ​

类型名称 ​

stopLocalPreview

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

订阅远端用户的视频流,并绑定视频渲染控件 ​

类型名称 ​

startRemoteView

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

更新远端用户的视频渲染控件 ​

类型名称 ​

updateRemoteView

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

停止订阅远端用户的视频流,并释放渲染控件 ​

类型名称 ​

stopRemoteView

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

停止订阅所有远端用户的视频流,并释放全部渲染资源 ​

类型名称 ​

stopAllRemoteView

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

初始化美颜组件 ​

类型名称 ​

initMeiHuBeauty

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

显示美颜组件 ​

类型名称 ​

showMeiHuBeauty

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

隐藏美颜组件 ​

类型名称 ​

hideMeiHuBeauty

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

美颜组件是否显示 ​

类型名称 ​

meiHuBeautyIsShow

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.resultBoolean组件显示状态
codeInteger返回类型,0.成功,其他:失败