LivePlayerContext.resume
解释:恢复
方法参数
Object object
object参数说明 :
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
success | Function | 否 | 接口调用成功的回调函数 | |
fail | Function | 否 | 接口调用失败的回调函数 | |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例
扫码体验
请使用百度APP扫码
图片示例
代码示例
- 在 js 文件中
Page({
data: {
disabled: false,
src: 'https://vd3.bdstatic.com/mda-ia8e6q3g23py8qdh/hd/mda-ia8e6q3g23py8qdh.mp4?playlist=%5B%22hd%22%5D&auth_key=1521549485-0-0-d5d042ba3555b2d23909d16a82916ebc&bcevod_channel=searchbox_feed&pd=share'
},
onShow(){
console.log('目前此组件在真机双端不能播放,请在开发者工具中查看完整效果');
},
onReady(e) {
const livePlayerContext = swan.createLivePlayerContext('myLive');
this.livePlayerContext = livePlayerContext;
this.livePlayerContext.play();
},
livePause(e) {
this.livePlayerContext.pause();
this.setData({disabled: true})
},
liveResume() {
this.livePlayerContext.resume();
this.setData({disabled: false})
}
});