Browse Source

播放器迁移

谢杰标 2 years ago
parent
commit
7bd55354b7
2 changed files with 344 additions and 401 deletions
  1. 277 11
      components/myPlayer/polyvPlayer.vue
  2. 67 390
      pages3/polyv/detail.vue

+ 277 - 11
components/myPlayer/polyvPlayer.vue

@@ -1,6 +1,6 @@
 <template>
   <view>
-    <view class="video_box" style="width: 100%; height: 421rpx">
+    <view class="player_box" style="width: 100%; height: 421rpx">
       <!-- #ifdef MP-WEIXIN -->
       <polyv-player
         id="playerVideo"
@@ -11,48 +11,314 @@
         :enablePlayGesture="true"
         :custom-cache="false"
         :object-fit="'contain'"
-        @statechange="onStateChange"
+        @statechange="wxStatechange"
         @fullscreenchange="fullscreenchange"
         @error="playError"
         :autoplay="autoplay"
         :page-gesture="true"
         :vslide-gesture="true"
         :vslide-gesture-in-fullscreen="true"
-        :isAllowSeek="isAllowSeek"
+        :isAllowSeek="allowSeek"
         :playbackRate="playbackRate"
         :enableAutoRotation="enableAutoRotation"
         @loadedmetadata="loadedmetadata"
       ></polyv-player>
       <!-- #endif -->
       <!-- #ifdef H5 -->
-      <view v-show="vid" id="player"></view>
+      <view id="player"></view>
       <!-- #endif -->
+      <template v-if="videoToastShow">
+        <cover-view class="video-toast__close" @click="closeToast()"
+          >X</cover-view
+        >
+        <cover-view class="video-toast">
+          <cover-view class="video-toast__text"
+            >您上次看到
+            {{
+              $method.secondToDate(videoCurrentTime)
+            }},正在自动续播</cover-view
+          >
+          <cover-view class="video-toast__btn" @click="restart()"
+            >从头播放</cover-view
+          >
+        </cover-view>
+      </template>
     </view>
   </view>
 </template>
 
 <script>
+var polyvPlayerContext = null;
+import { mapGetters } from "vuex";
 export default {
   name: "SaasMiniprogramPolyvPlayer",
-  prop: {
+  props: {
     vid: {
       type: String,
       defaule: "",
     },
+    autoplay: {
+      type: Boolean,
+      defaule: false,
+    },
+    allowSeek: {
+      type: String,
+      defaule: "on",
+    },
+    videoCurrentTime: {
+      type: Number,
+      defaule: 0,
+    },
+    playbackRate: {
+      type: Array,
+      defaule: () => {
+        return [1.0];
+      },
+    },
   },
   data() {
-    return {};
+    return {
+      barTimer: null,
+      vodPlayerJs: "https://player.polyv.net/resp/vod-player/latest/player.js",
+      videoToastShow: false,
+    };
+  },
+  mounted() {
+    // #ifdef MP-WEIXIN
+    polyvPlayerContext = this.selectComponent("#playerVideo");
+    console.log("🚀 ~ file: polyvPlayer.vue:89 ~ mounted ~ polyvPlayerContext:", polyvPlayerContext)
+    // #endif
   },
+  methods: {
+    loadPlayerScript(callback) {
+      if (!window.polyvPlayer) {
+        const myScript = document.createElement("script");
+        myScript.setAttribute("src", this.vodPlayerJs);
+        myScript.onload = callback;
+        document.body.appendChild(myScript);
+      } else {
+        callback();
+      }
+    },
+    // 播放视频
+    loadPlayer() {
+      const polyvPlayer = window.polyvPlayer;
+      this.$api.polyvVideoSign(this.vid).then(async (res) => {
+        let option = {
+          showLine: "off",
+          ban_history_time: "on",
+          vid: this.vid,
+          forceH5: true,
+          autoplay: this.autoplay, // 自动播放
+          ban_seek: this.allowSeek, // 是否禁止拖拽进度条
+          speed: this.playbackRate, // 倍数
+          banSeekDeviation: 7, // 做兼容
+          teaser_show: 1,
+          tail_show: 1,
+          hideSwitchPlayer: true,
+          watchStartTime: this.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
+          ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
+          sign: res.data.data.sign, // 移动端播放加密视频所需的签名
+        };
+        if (polyvPlayerContext) {
+          polyvPlayerContext.changeVid(option);
+        } else {
+          option = {
+            wrap: "#player",
+            width: "100%",
+            height: 218,
+            ...option,
+          };
+          polyvPlayerContext = polyvPlayer(option);
+          this.h5StateChange();
+        }
+      });
+    },
+    wxStatechange(newstate) {
+      // ["playing", "pause", "ended"]
+      const state = newstate.detail.newstate;
+      this.$emit(state);
+    },
+    h5StateChange() {
+      let states = {
+        s2j_onPlayerInitOver: "onPlayerInitOver", // 播放器初始化完毕时触发
+        s2j_onPlayStart: "onPlayStart", // 视频初次播放时触发
+        s2j_onVideoPause: "pause", // 视频暂停时触发
+        s2j_onVideoPlay: "playing", // 视频初次播放或由暂停恢复播放时触发
+        s2j_onPlayOver: "ended", // 当前视频播放完毕时触发
+        s2j_onVideoSeek: "onVideoSeek", // 视频拖拽进度时触发
+        s2j_onPlayerError: "playerError", // 播放出现错误时触发
+      };
+      let that = this;
+      for (const key in states) {
+        polyvPlayerContext.on(key, function () {
+          that[states[key]] && that[states[key]](...arguments);
+          that.$emit(states[key]);
+        });
+      }
+    },
+    onVideoSeek(start, end, vid) {
+      polyvPlayerContext.toggleFullscreen();
+      if (this.allowSeek !== "on") {
+        return;
+      }
+      if (end - start > 10) {
+        polyvPlayerContext.j2s_seekVideo(start);
+      }
+    },
+    seekVideo(time) {
+      // #ifdef MP-WEIXIN
+      polyvPlayerContext.seek(time);
+      // #endif
+      // #ifdef H5
+      polyvPlayerContext.j2s_seekVideo(time);
+      // #endif
+    },
+    restart() {
+      this.seekVideo(0);
+      this.closeToast();
+    },
+    // 播放时刻
+    playCurrentTime() {
+      if (!polyvPlayerContext) {
+        return 0;
+      }
+      // #ifdef MP-WEIXIN
+      return polyvPlayerContext.getCurrentTime(); //播放时刻
+      // #endif
+      // #ifdef H5
+      return polyvPlayerContext.j2s_getCurrentTime();
+      // #endif
+    },
+    playVideoTime() {
+      if (!polyvPlayerContext) {
+        return 0;
+      }
+      // #ifdef MP-WEIXIN
+      return polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
+      // #endif
+      // #ifdef H5
+      return polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
+      // #endif
+    },
 
-  mounted() {},
+    // 本次看的时长
 
-  methods: {},
+    // 暂停播放
+    playPause() {
+      // #ifdef MP-WEIXIN
+      polyvPlayerContext.pause();
+      // #endif
+      // #ifdef H5
+      polyvPlayerContext.j2s_pauseVideo();
+      // #endif
+    },
+    exitFullScreen() {
+      // #ifdef MP-WEIXIN
+      polyvPlayerContext.exitFullScreen();
+      // #endif
+      // #ifdef H5
+      polyvPlayerContext.toggleFullscreen();
+      // #endif
+    },
+    onPlayerInitOver() {
+      uni.$on("playPause", this.playPause);
+    },
+    onPlayStart() {
+      this.loadedmetadata();
+    },
+    loadedmetadata() {},
+    changeVid() {
+      if (!this.vid) {
+        return;
+      }
+      // #ifdef H5
+      this.loadPlayerScript(this.loadPlayer);
+      // #endif
+      // #ifdef MP-WEIXIN
+      polyvPlayerContext.changeVid(this.vid);
+      // #endif
+    },
+    closeToast() {
+      this.videoToastShow = false;
+    },
+  },
+  destroyed() {
+    if (polyvPlayerContext) {
+      polyvPlayerContext.destroy();
+    }
+  },
+  computed: {
+    ...mapGetters(["playSectionId"]),
+  },
   watch: {
-    vid: {
-        hander
+    playSectionId: {
+      handler(id, oldId) {
+        if (id) {
+          this.changeVid();
+        }
+      },
+      immediate: true,
+    },
+    videoCurrentTime: {
+      handler(time) {
+        if (time > 0) {
+          this.videoToastShow = true;
+          setTimeout(() => {
+            this.closeToast();
+          }, 3000);
+        }
+      },
+      immediate: true,
     },
   },
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.player_box {
+  position: relative;
+  #playerVideo {
+    position: relative;
+    z-index: 99;
+  }
+  .video-toast {
+    position: absolute;
+    width: 686rpx;
+    height: 80rpx;
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: 24rpx;
+    bottom: 100rpx;
+    left: 50%;
+    transform: translateX(-50%);
+    color: #fff;
+    display: flex;
+    font-size: 26rpx;
+    align-items: center;
+    overflow: visible;
+    z-index: 999;
+    &__text {
+      flex: 1;
+      margin-left: 40rpx;
+    }
+
+    &__btn {
+      width: 180rpx;
+      text-align: center;
+      border-left: 1rpx solid #fff;
+    }
+  }
+  .video-toast__close {
+    position: absolute;
+    right: 32rpx;
+    bottom: 184rpx;
+    width: 40rpx;
+    height: 40rpx;
+    line-height: 40rpx;
+    text-align: center;
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: 50%;
+    color: rgba(255, 255, 255, 0.3);
+  }
+}
+</style>

+ 67 - 390
pages3/polyv/detail.vue

@@ -1,9 +1,5 @@
 <template>
   <view class="polyv_detail">
-    <!-- <nav-bar
-      :title="detail.courseName || '课程详情'"
-      v-show="navShow"
-    ></nav-bar> -->
     <uni-nav-bar
       left-icon="back"
       :statusBar="true"
@@ -18,75 +14,19 @@
           mode="widthFix"
           style="width: 100%; height: 421rpx"
         ></image>
-        <image
-          v-if="false"
-          class="video_play"
-          src="/static/play.png"
-          @click="startVideo"
-        ></image>
       </view>
       <view v-else>
-        <!-- v-if="playVID" -->
-        <!-- #ifdef MP-WEIXIN -->
-        <view class="video_box" style="width: 100%; height: 421rpx">
-          <polyv-player
-            v-if="playVID"
-            id="playerVideo"
-            playerId="playerVideo"
-            height="421rpx"
-            :vid="vid"
-            :showSettingBtn="true"
-            :enablePlayGesture="true"
-            :custom-cache="false"
-            :object-fit="'contain'"
-            @statechange="onStateChange"
-            @fullscreenchange="fullscreenchange"
-            @error="playError"
-            :autoplay="autoplay"
-            :page-gesture="true"
-            :vslide-gesture="true"
-            :vslide-gesture-in-fullscreen="true"
-            :isAllowSeek="isAllowSeek"
-            :playbackRate="playbackRate"
-            :enableAutoRotation="enableAutoRotation"
-            @loadedmetadata="loadedmetadata"
-          ></polyv-player>
-          <!-- :startTime="startTime" -->
-          <cover-view
-            class="video-toast__close"
-            v-if="videoToastShow"
-            @click="closeToast()"
-            >X</cover-view
-          >
-          <cover-view class="video-toast" v-if="videoToastShow">
-            <cover-view class="video-toast__text"
-              >您上次看到 {{ seekTime }},正在自动续播</cover-view
-            >
-            <cover-view class="video-toast__btn" @click="restart()"
-              >从头播放</cover-view
-            >
-          </cover-view>
-        </view>
-        <!-- #endif -->
-        <!-- #ifdef H5 -->
-        <view class="video_box" style="width: 100%; height: 421rpx">
-          <view v-show="vid" id="player"></view>
-          <cover-view
-            class="video-toast__close"
-            v-if="videoToastShow"
-            @click="closeToast()"
-            >X</cover-view
-          >
-          <cover-view class="video-toast" v-if="videoToastShow">
-            <cover-view class="video-toast__text"
-              >您上次看到 {{ seekTime }},正在自动续播</cover-view
-            >
-            <cover-view class="video-toast__btn" @click="restart()"
-              >从头播放</cover-view
-            >
-          </cover-view>
-        </view>
-        <!-- #endif -->
+        <my-player
+          ref="player"
+          :vid="playVID"
+          :autoplay="autoplay"
+          :allowSeek="isAllowSeek"
+          :playbackRate="playbackRate"
+          :videoCurrentTime="recordObj.videoCurrentTime"
+          @playing="playing"
+          @pause="pause"
+          @ended="ended"
+        ></my-player>
         <view
           class="video_box"
           style="width: 100%; height: 421rpx"
@@ -800,9 +740,9 @@ import courseSection from "@/components/course/courseSection.vue";
 import handoutsBox from "@/components/course/handoutsBox.vue";
 import PopupPhoto from "@/components/popup/index.vue";
 import myCompressImage from "@/common/compressPhoto.js";
+import myPlayer from "../../components/myPlayer/polyvPlayer.vue";
 import { mapGetters, mapMutations } from "vuex";
 import { lockAction } from "../../utils/lock";
-var polyvPlayerContext = null;
 export default {
   components: {
     courseModule,
@@ -810,6 +750,7 @@ export default {
     courseSection,
     PopupPhoto,
     handoutsBox,
+    myPlayer,
   },
   data() {
     return {
@@ -820,7 +761,6 @@ export default {
       lockTimer: null,
       orderGoodsId: 0,
       noticeShow: false,
-      navShow: true,
       enableAutoRotation: true,
       seekTime: "",
       toastTimer: null,
@@ -880,7 +820,7 @@ export default {
       noteList: [],
       noteValue: "",
       noteId: 0,
-      recordObj: 0,
+      recordObj: {},
       gradeDetail: {},
       isTaking: true, //是否正在拍照
       needSeek: false, //第一次播放是否需要跳转
@@ -892,7 +832,6 @@ export default {
       photoIndex: 0, //当前位于拍照的区间下标 从0开始
       photoHistoryList: [], //已拍照历史的下标点
       sectionItem: {},
-      businessData: {},
       showNotes: true,
       uploadLock: false, //上传图片
       isPlayRebuild: false, //是否正在播放重修视频needOpen
@@ -947,7 +886,7 @@ export default {
       return this.sectionItem.learning != 1;
     },
     orderNum() {
-      return this.businessData.goodsLearningOrder;
+      return this.goodsData.goodsLearningOrder;
     },
     list() {
       let list = [
@@ -969,6 +908,9 @@ export default {
       }
       return list;
     },
+    $plv() {
+      return this.$refs.player;
+    },
   },
   watch: {
     showSet(n) {
@@ -1073,9 +1015,6 @@ export default {
               }
             });
             this.subList = [...allItem, ...newArr];
-            if (res.data.rows.length) {
-              this.courseBusiness(res.data.rows[0].businessId);
-            }
             if (res.data.total > 1) {
               this.getUserWatchLast();
             } else if (res.data.total == 1) {
@@ -1085,15 +1024,6 @@ export default {
           }
         });
     },
-    /**
-     * 获取业务层次详情
-     */
-    courseBusiness(businessId) {
-      this.$api.courseBusiness(businessId).then((res) => {
-        this.businessData = res.data.data;
-        console.log(this.businessData, "this.businessData");
-      });
-    },
     // 查询用户最后一次看的录播的信息
     getUserWatchLast() {
       this.$http({
@@ -1661,6 +1591,7 @@ export default {
     },
     studyRecordQueryLiveLast() {
       // /study/record/queryLiveLast
+      console.log(4165)
       this.$api
         .studyRecordQueryLiveLast({
           gradeId: this.gradeId,
@@ -1669,14 +1600,14 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
-          if (!data.sectionId) {
-            data = this.menuAllList[0];
-          } else {
-            if (data.learning == 1 && this.orderNum == 2) {
-              let next = this.menuAllList.find((e) => e.studyStatus != 1);
-              next && (data = next);
-            }
-          }
+          // if (!data.sectionId) {
+          //   data = this.menuAllList[0];
+          // } else {
+          //   if (data.learning == 1 && this.orderNum == 2) {
+          //     let next = this.menuAllList.find((e) => e.studyStatus != 1);
+          //     next && (data = next);
+          //   }
+          // }
           this.initPlayVideo(data);
         });
     },
@@ -1968,30 +1899,11 @@ export default {
         // 防止loadedmetadata事件第二次触发
         return;
       }
-      // #ifdef MP-WEIXIN
-      polyvPlayerContext = this.selectComponent("#playerVideo");
-      // #endif
       this.hasStart = true;
-      uni.$off("playPause");
-      uni.$on("playPause", () => {
-        // #ifdef MP-WEIXIN
-        polyvPlayerContext.pause();
-        // #endif
-        // #ifdef H5
-        polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
-        // #endif
-      });
-      if (!this.recordObj.videoCurrentTime) {
-        this.postStudyRecord(0);
-      }
-      this.studyTimer && clearInterval(this.studyTimer);
-      this.studyTimer = setInterval(() => {
-        this.postStudyRecord(0);
-      }, 15000);
     },
     getPhotoLastRecord() {
-      if (this.erJianErZao || !this.playSecIsLearn || this.photoNum <= 0){
-        return
+      if (this.erJianErZao || !this.playSecIsLearn || this.photoNum <= 0) {
+        return;
       }
       let self = this;
       let data = {
@@ -2325,7 +2237,6 @@ export default {
         polyvPlayerContext.changeVid(this.vid);
       }
       // #endif
-
       this.recordObj = { videoCurrentTime: item.noteSecond };
       if (this.recordObj.videoCurrentTime) {
         this.needSeek = true; //需要跳转到播放记录
@@ -2339,25 +2250,11 @@ export default {
       if (this.timer) {
         clearInterval(this.timer);
       }
-      // #ifdef H5
-      // await this.clears();
-      // #endif
-      this.vid = item.recordingUrl;
-      // #ifdef MP-WEIXIN
-      if (this.vid) {
-        polyvPlayerContext && polyvPlayerContext.changeVid(this.vid);
-      }
-      // #endif
-
-      this.recordObj = null;
+      this.$store.commit("setPlayVID", {
+        playVID: item.recordingUrl,
+      });
       this.recordObj = await this.getRecordLast();
-      this.needSeek = true; //跳转到播放记录
       this.startStatus = true;
-      // #ifdef H5
-      await this.loadPlayerScript(this.loadPlayer);
-      // #endif
-      //获取节笔记
-      this.getNoteList();
     },
     getRecordLast() {
       return new Promise((resolve) => {
@@ -2589,18 +2486,8 @@ export default {
       this.postAnswer();
     },
     postStudyRecord(status = 0, sectionId = this.playSectionId) {
-      let currentTime = 0;
-      let PlayDuration = 0;
-      if (polyvPlayerContext) {
-        // #ifdef MP-WEIXIN
-        currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
-        PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
-        // #endif
-        // #ifdef H5
-        currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
-        PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
-        // #endif
-      }
+      let currentTime = this.$plv.playCurrentTime();
+      let PlayDuration = this.$plv.playVideoTime();
       if (currentTime < 10 && !this.ossAvatarUrl) {
         return;
       }
@@ -2803,13 +2690,7 @@ export default {
       });
     },
     timeEvent() {
-      if (polyvPlayerContext != null) {
-        // #ifdef MP-WEIXIN
-        this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
-        // #endif
-        // #ifdef H5
-        this.playTime = polyvPlayerContext.j2s_getCurrentTime();
-        // #endif
+        let playTime = this.$plv.playCurrentTime();
         this.configPhoto();
         console.info(this.photoList, "photoList");
         let photoTime = 0; //获取拍照秒数
@@ -2849,7 +2730,6 @@ export default {
             }
           }
         }
-      }
     },
     closeToast() {
       clearTimeout(this.toastTimer);
@@ -2882,58 +2762,41 @@ export default {
         },
       }).then((res) => {});
     },
-    async onStateChange(newstate, oldstate) {
-      polyvPlayerContext = this.selectComponent("#playerVideo");
-      if (newstate.detail.newstate == "playing") {
-        console.log("播放");
-        if (this.noticeShow) {
-          polyvPlayerContext.pause();
-          return;
-        }
-        if (this.needSeek) {
-          if (this.recordObj.videoCurrentTime) {
-            polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
-            this.seekTime = this.$method.secondToDate(
-              this.recordObj.videoCurrentTime
-            );
-            this.videoToastShow = true;
-            this.toastTimer = setTimeout(() => {
-              this.videoToastShow = false;
-            }, 3000);
-          } else {
-            polyvPlayerContext.seek(1); //避免相同节继续播放
-          }
-
-          polyvPlayerContext.play();
-          this.needSeek = false;
-          // 新增用户视频学习日志
-          this.studyLog();
-          // 提交学习记录
-        }
-        //开始播放
-        this.timer && clearInterval(this.timer);
-        if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
-          this.clearPauseTimer();
-          this.isReach = false;
-          this.timer = setInterval(this.timeEvent, 1000); //定时器
-        }
+    playing() {
+      if (this.noticeShow) {
+        this.$plv.playPause();
+        return;
       }
-      if (newstate.detail.newstate == "pause") {
-        console.log("暂停");
-        this.erJianErZaoPauseTip();
-        clearInterval(this.timer);
-        //暂停提交记录
+      this.timer && clearInterval(this.timer);
+      if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
+        this.clearPauseTimer();
+        this.isReach = false;
+        this.timer = setInterval(this.timeEvent, 1000); //定时器
       }
-      if (newstate.detail.newstate == "ended") {
-        clearInterval(this.timer);
-        uni.showToast({
-          icon: "none",
-          title: "播放完毕",
-        });
-        this.hasStart = false;
-        await this.postStudyRecord(1);
-        this.nextSection();
+      this.studyLog();
+      if (!this.recordObj.videoCurrentTime) {
+        this.postStudyRecord(0);
       }
+      this.studyTimer && clearInterval(this.studyTimer);
+      this.studyTimer = setInterval(() => {
+        this.postStudyRecord(0);
+      }, 15000);
+    },
+    pause() {
+      this.erJianErZaoPauseTip();
+      clearInterval(this.timer);
+      clearInterval(this.studyTimer);
+    },
+    async ended() {
+      this.hasStart = false;
+      uni.showToast({
+        icon: "none",
+        title: "播放完毕",
+      });
+      clearInterval(this.timer);
+      clearInterval(this.studyTimer);
+      await this.postStudyRecord(1);
+      this.nextSection();
     },
     //播放下一节
     nextSection() {
@@ -3289,16 +3152,6 @@ export default {
       this.photoPopup = false;
       this.enableAutoRotation = true;
     },
-    /**
-     * 进入全屏
-     */
-    fullscreenchange(event) {
-      if (event.detail.direction == "vertical") {
-        this.navShow = true;
-      } else if (event.detail.direction == "horizontal") {
-        this.navShow = false;
-      }
-    },
     checkFinishRequiredCourse() {
       return this.$api
         .checkFinishRequiredCourse({
@@ -3323,10 +3176,6 @@ export default {
     getGoodsDetail() {
       let self = this;
       this.$api.goodsDetail(this.goodsId).then(async (res) => {
-        console.log(
-          "🚀 ~ file: detail.vue:3398 ~ this.$api.goodsDetail ~ res:",
-          res
-        );
         this.goodsData = res.data.data;
         this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
         if (this.goodsData.buyNote) {
@@ -3334,7 +3183,6 @@ export default {
         }
         self.gradeId = self.goodsData.gradeId;
         self.erJianErZao = self.goodsData.erJianErZao;
-        this.courseBusiness(this.goodsData.businessId);
         self.getMenuList();
         self.getReMenuList(); //获取重修目录
         setTimeout(function () {
@@ -3371,9 +3219,6 @@ export default {
         }
       });
     },
-    startVideo() {
-      this.startStatus = true;
-    },
     getAnswerList() {
       this.$api
         .answerList({
@@ -3462,130 +3307,6 @@ export default {
     clickMulu() {
       this.muluStyle = !this.muluStyle;
     },
-    loadPlayerScript(callback) {
-      if (!window.polyvPlayer) {
-        const myScript = document.createElement("script");
-        myScript.setAttribute("src", this.vodPlayerJs);
-        myScript.onload = callback;
-        document.body.appendChild(myScript);
-      } else {
-        callback();
-      }
-    },
-    // 播放视频
-    loadPlayer() {
-      const polyvPlayer = window.polyvPlayer;
-      this.$api.polyvVideoSign(this.vid).then(async (res) => {
-        let option = {
-          showLine: "off",
-          ban_history_time: "on",
-          vid: this.vid,
-          forceH5: true,
-          autoplay: this.autoplay, // 自动播放
-          ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
-          speed: this.playbackRate, // 倍数
-          banSeekDeviation: 7, // 做兼容
-          teaser_show: 1,
-          tail_show: 1,
-          hideSwitchPlayer: true,
-          watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
-          ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
-          sign: res.data.data.sign, // 移动端播放加密视频所需的签名
-        };
-        if (polyvPlayerContext) {
-          polyvPlayerContext.changeVid(option);
-        } else {
-          option = {
-            wrap: "#player",
-            width: "100%",
-            height: 218,
-            ...option,
-          };
-          polyvPlayerContext = await polyvPlayer(option);
-        }
-        polyvPlayerContext.on("s2j_onPlayStart", async (vid) => {
-          console.log("视频初次播放时触发:");
-          // #ifdef H5
-          // h5禁止拖动进度条
-          if (!this.$method.isWeixin()) {
-            this.clearBarTimer();
-            let originTime = this.recordObj.videoCurrentTime || 0;
-            if (this.H5isAllowSeek == "on") {
-              this.barTimer = setInterval(() => {
-                const currentTime = polyvPlayerContext.j2s_getCurrentTime();
-                if (
-                  currentTime - originTime > 15 ||
-                  currentTime - originTime < 0
-                ) {
-                  polyvPlayerContext.j2s_seekVideo(originTime);
-                } else {
-                  originTime = currentTime;
-                }
-              }, 2000);
-            }
-          }
-          // #endif
-          this.loadedmetadata();
-        });
-        polyvPlayerContext.on("s2j_onVideoPause", () => {
-          // 视频暂停时触发
-          console.log("视频暂停时触发", this.vid);
-          this.erJianErZaoPauseTip();
-          this.clearBarTimer();
-          clearInterval(this.studyTimer);
-          clearInterval(this.timer);
-        });
-        polyvPlayerContext.on("s2j_onVideoPlay", () => {
-          // 视频初次播放或由暂停恢复播放时触发
-          console.log("视频初次播放或由暂停恢复播放时触发");
-          if (this.noticeShow) {
-            polyvPlayerContext.j2s_pauseVideo();
-            return;
-          }
-          if (this.needSeek) {
-            if (this.recordObj.videoCurrentTime) {
-              this.seekTime = this.$method.secondToDate(
-                this.recordObj.videoCurrentTime
-              );
-
-              this.videoToastShow = true;
-              this.toastTimer = setTimeout(() => {
-                this.videoToastShow = false;
-              }, 3000);
-            }
-
-            this.needSeek = false;
-            // 新增用户视频学习日志
-            this.studyLog();
-          }
-          //开始播放
-          this.timer && clearInterval(this.timer);
-          if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
-            this.clearPauseTimer();
-            this.isReach = false;
-            this.timer = setInterval(this.timeEvent, 1000); //定时器
-          }
-
-          this.studyTimer && clearInterval(this.studyTimer);
-          this.studyTimer = setInterval(() => {
-            this.postStudyRecord(0, this.playSectionId);
-          }, 15000);
-        });
-        polyvPlayerContext.on("s2j_onPlayOver", async () => {
-          // 当前视频播放完毕时触发
-          this.hasStart = false;
-          this.clearBarTimer();
-          clearInterval(this.studyTimer);
-          clearInterval(this.timer);
-          uni.showToast({
-            icon: "none",
-            title: "播放完毕",
-          });
-          await this.postStudyRecord(1);
-          this.nextSection(); // 播放下一节
-        });
-      });
-    },
     clears() {
       return new Promise((resolve, reject) => {
         this.vid = "";
@@ -4351,50 +4072,6 @@ page {
 }
 .video_box {
   position: relative;
-  #playerVideo {
-    position: relative;
-    z-index: 99;
-  }
-
-  .video-toast {
-    position: absolute;
-    width: 686rpx;
-    height: 80rpx;
-    background: rgba(0, 0, 0, 0.6);
-    border-radius: 24rpx;
-    bottom: 100rpx;
-    left: 50%;
-    transform: translateX(-50%);
-    color: #fff;
-    display: flex;
-    font-size: 26rpx;
-    align-items: center;
-    overflow: visible;
-    z-index: 999;
-    &__text {
-      flex: 1;
-      margin-left: 40rpx;
-    }
-
-    &__btn {
-      width: 180rpx;
-      text-align: center;
-      border-left: 1rpx solid #fff;
-    }
-  }
-
-  .video-toast__close {
-    position: absolute;
-    right: 32rpx;
-    bottom: 184rpx;
-    width: 40rpx;
-    height: 40rpx;
-    line-height: 40rpx;
-    text-align: center;
-    background: rgba(0, 0, 0, 0.6);
-    border-radius: 50%;
-    color: rgba(255, 255, 255, 0.3);
-  }
 }
 .rotoct {
   transform: rotate(90deg);