1. 程式人生 > 實用技巧 >vue-video-player 相關事件筆記

vue-video-player 相關事件筆記

安裝引入基礎使用部分 請移步:https://juejin.cn/post/6844903989641740296

相關事件方法:

// 載入視訊
      // this.$refs.videoPlayer.player.load();
      // 播放視訊
      // this.$refs.videoPlayer.player.play();
      // 暫停播放
      // this.$refs.videoPlayer.player.pause();
      // 直接全屏 如果當前裝置支援的話
      // this.$refs.videoPlayer.player.requestFullscreen();
      // setTimeout(() => {
      //   // 在全屏模式下,將視訊恢復到正常大小
      //   this.$refs.videoPlayer.player.exitFullscreen();
      // }, 1000);
      // 當環境不支援全屏時 則擴充套件鋪滿容器
      // this.$refs.videoPlayer.player.enterFullWindow();
      // 進入全屏後操作的事件
      setTimeout(() => {
        // 重置播放器
        // this.$refs.videoPlayer.player.reset();
        // 返回當前播放源資訊
        // console.log("currentSources : ", this.$refs.videoPlayer.player.currentSources());
        // 獲取或者設定預載入屬性
        // this.$refs.videoPlayer.player.preload(val);
        // 播放控制元件是否顯示
        // this.$refs.videoPlayer.player.controls(false);
      }, 1000);