dedsudiyu 5 meses atrás
pai
commit
e72a044638
2 arquivos alterados com 5 adições e 3 exclusões
  1. 1 0
      src/App.vue
  2. 4 3
      src/components/H5PlayerVideo.vue

+ 1 - 0
src/App.vue

@@ -50,6 +50,7 @@
                 let obj = {
                     page:'1',
                     pageSize:'4',
+                    protocol:window.location.href.indexOf('https') !== -1?'wss':'ws'
                 };
                 if(urlData.type == 1){
                     obj.buildId = urlData.buildId;

+ 4 - 3
src/components/H5PlayerVideo.vue

@@ -30,7 +30,8 @@
         mounted() {
             this.$nextTick(() => {
                 this.initH5Player(1)
-                this.initPlayer(this.videoData.url, 0)
+                let type = this.videoData.url.indexOf('wss') !== -1?1:0;
+                this.initPlayer(this.videoData.url, 0,type)
             })
         },
         methods: {
@@ -120,11 +121,11 @@
                     }
                 })
             },
-            initPlayer(url, index) {
+            initPlayer(url, index,type) {
                 this.myPlugin.JS_Play(url,
                     {
                         playURL: url, // 流媒体播放时必传
-                        mode: 0 // 解码类型:0=普通模式; 1=高级模式 默认为0
+                        mode: type?type:0 // 解码类型:0=普通模式; 1=高级模式 默认为0
                         // ...
                     },
                     index //当前窗口下标