wx.createLivePusherContext-创建并返回 live-pusher 上下文 LivePusherContext 对象

wx.createLivePusherContext()

基础库 1.7.0 开始支持,低版本需做兼容处理

创建并返回 live-pusher 上下文 LivePusherContext 对象,LivePusherContext 与页面的 <live-pusher /> 组件绑定,一个页面只能有一个 live-pusher,通过它可以操作对应的 <live-pusher/> 组件。 在自定义组件下,第一个参数传入组件实例this,以操作组件内 <live-pusher/> 组件

livePusherContext

livePusherContext 对象的方法列表:

方法参数说明
startOBJECT播放推流
stopOBJECT停止推流
pauseOBJECT暂停推流
resumeOBJECT恢复推流
switchCameraOBJECT切换前后摄像头


所有方法的 OBJECT 参数列表:

参数类型必填说明
successFunction接口调用成功的回调函数
failFunction接口调用失败的回调函数
completeFunction接口调用结束的回调函数(调用成功、失败都会执行)