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
属性类型默认值必填说明
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

LivePlayerContext.pause(Object object)

暂停

参数

Object object
属性类型默认值必填说明
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

.play

LivePlayerContext.play(Object object)

播放

参数

Object object

LivePlayerContext.requestFullScreen(Object object)

进入全屏

参数

Object object
属性类型默认值必填说明
directionnumber0设置全屏时的方向
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)
object.direction的合法值
说明
0正常竖向
90屏幕逆时针90度
-90屏幕顺时针90度

.resume

LivePlayerContext.resume(Object object)

恢复

参数

Object object

LivePlayerContext.snapshot(Object object)

截图

参数

Object object
属性类型默认值必填说明
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

object.success回调函数

参数
Object res
属性类型说明
tempImagePathstring图片文件的临时路径
widthstring图片的宽度
heightstring图片的高度

.stop

LivePlayerContext.stop(Object object)

停止

参数

Object object