LivePlayerContext.exitFullScreen

解释:退出全屏

方法参数

Object object

object参数说明 :

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

示例

在开发者工具中预览效果

扫码体验

LivePlayerContext.exitFullScreen - 图1请使用百度APP扫码

图片示例

LivePlayerContext.exitFullScreen - 图2

LivePlayerContext.exitFullScreen - 图3

LivePlayerContext.exitFullScreen - 图4

代码示例

  • 在 js 文件中
  1. Page({
  2. data: {
  3. 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'
  4. },
  5. onShow(){
  6. console.log('目前此组件在真机双端不能播放,请在开发者工具中查看完整效果');
  7. },
  8. onReady(e) {
  9. const livePlayerContext = swan.createLivePlayerContext('myLive');
  10. this.livePlayerContext = livePlayerContext;
  11. this.livePlayerContext.play();
  12. this.livePlayerContext.requestFullScreen({direction: 90});
  13. let that = this;
  14. setTimeout(function () {
  15. that.livePlayerContext.exitFullScreen();
  16. }, 5000);
  17. }
  18. });