Browse Source

流畅服务器控制

吕君喜 3 năm trước cách đây
mục cha
commit
dc51ef13ea
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      src/containers/center/play/index.vue

+ 7 - 1
src/containers/center/play/index.vue

@@ -227,6 +227,8 @@
         let mediaUrl = this.mediaUrl;
         if( val == 'ld'){
           mediaUrl = mediaUrl.replace('/hls/', '/ld/');
+        }else{
+          mediaUrl = mediaUrl.replace('/ld/', '/hls/');
         }
         this.options.sources = [{src:mediaUrl,type: "application/x-mpegURL"}];
         this.options.playtimes = this.media.position||0;
@@ -365,7 +367,11 @@
         this.media.index = index
         httpServer('course.GetMedia', {id:item.id}).then( ({data, code}) => {
           this.mediaUrl = data
-          this.mediaType = 'hls';
+          if(this.mediaUrl.indexOf( '/hls/') >-1 ){
+            this.mediaType = 'hls';
+          }else{
+            this.mediaType = 'ld';
+          }
           this.options.sources = [{src:this.mediaUrl,type: "application/x-mpegURL"}];
           this.options.playtimes = item.position;
           this.options.autoplay = item.position>0;