Ver código fonte

自动播放下一个

y595705120 23 horas atrás
pai
commit
ef41db2702
1 arquivos alterados com 5 adições e 9 exclusões
  1. 5 9
      src/containers/center/play/play.vue

+ 5 - 9
src/containers/center/play/play.vue

@@ -474,6 +474,7 @@
           position: curTimes,
           isFinish
         };
+        let that = this
         httpServer("course.tick", param, true).then(res => {
           if (res.code == 200) {
             let {
@@ -482,15 +483,10 @@
               pause,
               closed
             } = res.data
-            if (pause || closed) {
-              this.doPause();
-              if (closed) {
-                this.$message.errorMsg("禁止多处同时学习", 5);
-              } else if (pause) {
-                this.$message.errorMsg("禁止多处同时学习", 5);
+              if (pause || closed) {
+                that.playNext()
+                return
               }
-              return
-            }
               if (!skip) {
                 let curTimes = parseInt(this.getPlayerTime())
                 if (position < curTimes + 5) {
@@ -506,6 +502,7 @@
       },
       loadMedia(item) {
         this.media = item;
+        this.stopTick()
         httpServer('course.GetMedia', {
           id: item.id
         }).then(res => {
@@ -525,7 +522,6 @@
           this.onPlay = false
           this.hasSeeked = false
           this.hiddenStartTime = 0
-          this.stopTick()
           this.options = {
             ...this.options,
             sources: [{