(vue项目)ezuikit-js萤石组件实现三分钟自动暂停

75 阅读1分钟

萤石每走一秒都是money啊,所以做了个播放三分钟自动暂停的功能

this.player = new EZUIKit.EZUIKitPlayer(
        // this.option
        {
          id: this.id, // 视频容器ID
          accessToken: accessToken,
          url: url,
          autoplay: false,
          // simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
          //template: 'theme',
          // poster:'../../../assets/img/蒙版组 12.png',
          plugin: ['talk'], // 加载插件,talk-对讲
          themeData: this.themeData,
          width: this.widthBox,
          height: this.heightBox,
          landleError: (data) => {
            //console.log('视频播放失败',data);
          },
          handleSuccess: () => {
            setTimeout(() => {
              this.player && this.player.stop()
            }, 30000)
            // console.log("播放成功回调函数,此处可执行播放成功后续动作")
          },
        }
      )