LivePlayerContext qq.createLivePlayerContext(string id, Object this)
创建上下文LivePlayerContext
对象。
参数
string id
组件的id
Object this
在自定义组件下,当前组件实例的this,以操作组件内组件
返回值
LivePlayerContext 实例,可通过qq.createLivePlayerContext获取。
LivePlayerContext
通过跟一个组件绑定,操作对应的 live-player
组件。
方法
LivePlayerContext.play()
LivePlayerContext.stop()
停止
LivePlayerContext.mute()
静音
LivePlayerContext.pause()
暂停
LivePlayerContext.resume()
恢复
LivePlayerContext.requestFullScreen(Object object)
进入全屏
LivePlayerContext.exitFullScreen()
退出全屏
LivePlayerContext.snapshot()
截图
LivePlayerContext.exitFullScreen(Object object)
参数
Object object
.mute
LivePlayerContext.mute(Object object)
静音
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
LivePlayerContext.pause(Object object)
暂停
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
.play
LivePlayerContext.play(Object object)
播放
参数
Object object
LivePlayerContext.requestFullScreen(Object object)
进入全屏
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
direction | number | 0 | 否 | 设置全屏时的方向 |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.direction的合法值
值 | 说明 |
---|---|
0 | 正常竖向 |
90 | 屏幕逆时针90度 |
-90 | 屏幕顺时针90度 |
.resume
LivePlayerContext.resume(Object object)
恢复
参数
Object object
LivePlayerContext.snapshot(Object object)
截图
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.success回调函数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
tempImagePath | string | 图片文件的临时路径 |
width | string | 图片的宽度 |
height | string | 图片的高度 |
.stop
LivePlayerContext.stop(Object object)
停止