y595705120 3 tahun lalu
induk
melakukan
b83146c7c6

+ 2 - 2
config/index.js

@@ -3,8 +3,8 @@
 // see http://vuejs-templates.github.io/webpack for documentation.
 //
 // const TARGET = "http://study.ndjsxh.cn:8888/"
-// const TARGET = "http://localhost:8000/"
-const TARGET = "http://sm.hqedust.com:8889/"
+const TARGET = "http://localhost:8000/"
+// const TARGET = "http://sm.hqedust.com:8889/"
 const path = require('path')
 
 module.exports = {

+ 7 - 3
src/containers/center/play/components/media.vue

@@ -80,7 +80,12 @@
         if( !this.isReady ){
           this.setposition( this.media.position );
         }
-        console.log("isReady", this.media.position )
+        let myPlayer = this.$refs.videoPlayer.player;
+        if( this.media.playRate>0 ){
+          let playRate = 1 + (+this.media.playRate/100);
+          myPlayer.playbackRate(playRate)
+        }
+        // myPlayer.playbackRate(1.3)
         this.isReady = true
       },
       onPlayerTimeupdate( player ){
@@ -98,7 +103,7 @@
           let player = this.$refs.videoPlayer.player;
           player.currentTime( position );
         }
-        console.log("setposition", position, this.media.duration, this.media.isFinish)
+
         if( this.media.position >= this.media.duration-30 && !this.media.isFinish){
           this.tick( true )
         }
@@ -111,7 +116,6 @@
         this.tick( true )
       },
       doPause( ){
-        console.log( "pause" )
         let myPlayer = this.$refs.videoPlayer.player;
         myPlayer && myPlayer.pause()
         this.onPlay = false

+ 4 - 4
src/containers/center/play/index.vue

@@ -318,8 +318,8 @@
       updateShowList(){
         let show = this.show;
         this.showList = this.list.filter( item=>{
-          if( show == 1) return item.percent<100
-          if( show == 2) return item.percent>=100
+          if( show == 1) return !item.isFinish
+          if( show == 2) return !!item.isFinish
           return false
         })
         //
@@ -331,7 +331,7 @@
         for( let i = 0; i< this.list.length;i++){
           let item = this.list[i]
           this.info.axs  += (item.xs/10)
-          if( item.percent >= 100){
+          if( item.isFinish ){
             this.info.gxs += (item.xs/10)
             this.info.fcount++
           }
@@ -354,7 +354,7 @@
         httpServer('course.GetMedia', {id:item.id}).then( ({data, code}) => {
           item.url = data
           this.options.sources = [{src:item.url}];
-          console.log("position", item.position)
+          this.options.playbackRate = 2;
           this.options.playtimes = item.position;
           this.mediaDialog = true;
         });

+ 4 - 8
src/utils/index.js

@@ -99,13 +99,9 @@ export function parseTime(time, cFormat) {
 }
 
 
-
 export function getPercent( item ){
-  if ( item.isFinish ) {
-    return 100
-  }else if ( item.position >= item.duration){
-     return 99.9
-  } else {
-    return parseInt(item.position * 10000 / item.duration) / 100
-  }
+  if( item.isFinish ) 100;
+  let percent = parseInt(item.position * 10000 / item.duration) / 100;
+  if( percent >= 100) return 99.99;
+  return parseInt(item.position * 10000 / item.duration) / 100
 }