xuqiaoying 2 年之前
父節點
當前提交
f6cf04c798
共有 1 個文件被更改,包括 15 次插入7 次删除
  1. 15 7
      pages3/polyv/detail.vue

+ 15 - 7
pages3/polyv/detail.vue

@@ -846,13 +846,19 @@ export default {
     this.$store.getters.dictObj;
   },
   onUnload() {
+    console.log('onUnloadonUnloadonUnload');
     this.originUnload()
   },
   onHide() {
+    console.log('onHideonHideonHideonHide');
     this.originUnload()
   },
   mounted() {
   },
+  beforeDestroy() {
+    console.log('beforeDestroy');
+    this.originUnload()
+  },
   methods: {
     ...mapMutations(["updateChapterOpen","updateLiveLast"]),
     // 新增微信公众号模板消息点击数据
@@ -1414,7 +1420,8 @@ export default {
           }
 				} else {
           this.CountTo = -1
-          if (this.goodsPlayConfig.autoPlay > 0) {
+          console.log('this.goodsPlayConfig', this.goodsPlayConfig);
+          if (this.goodsPlayConfig && this.goodsPlayConfig.autoPlay > 0) {
             this.autoplay = true
             // var polyvPlayerContext = this.selectComponent("#playerVideo")
             // #ifdef MP-WEIXIN
@@ -2507,7 +2514,7 @@ export default {
         PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
         // #endif
       }
-      console.log('---学习记录:currentTime', polyvPlayerContext, currentTime);
+      console.log('---学习记录:currentTime', currentTime);
       if (this.playChannelId > 0) {
         currentTime = 2; //直播无法获取,无论开始结束都传2秒
       }
@@ -3300,6 +3307,7 @@ export default {
       this.muluStyle = !this.muluStyle
     },
     loadPlayerScript(callback) {
+      console.log( 'window.polyvPlayer:', window.polyvPlayer);
       if (!window.polyvPlayer) {
         const myScript = document.createElement("script");
         myScript.setAttribute("src", this.vodPlayerJs);
@@ -3313,9 +3321,8 @@ export default {
     loadPlayer() {
       const polyvPlayer = window.polyvPlayer
       console.log('h5开始', this.recordObj.videoCurrentTime, 666, this.vid);
-      this.$api.polyvVideoSign(this.vid).then((res) => {
-        console.log(res, "res2");
-        this.player = polyvPlayer({
+      this.$api.polyvVideoSign(this.vid).then(async (res) => {
+        this.player = await polyvPlayer({
           wrap: "#player",
           width: '100%',
           showLine: "off",
@@ -3340,9 +3347,10 @@ export default {
 
         polyvPlayerContext = this.player
         console.log('this.player:', this.player, 'polyvPlayerContext:', polyvPlayerContext)
+
         this.postStudyRecord(0)
         this.player.on("s2j_onPlayStart", (vid) => { // 视频初次播放时触发
-          console.log('视频初次播放时触发: vid', vid);
+          console.log('视频初次播放时触发:');
           this.loadedmetadata()
         });
 
@@ -3389,7 +3397,7 @@ export default {
           this.postStudyRecord(1)
           this.nextSection() // 播放下一节
         })
-        console.log('借宿结束结束');
+
       })
     },
     clears() {