Browse Source

给视频做加载动画前的一次修改

liuwei 4 years ago
parent
commit
c16513786a

+ 1 - 7
src/renderer/components/BigShow.vue

@@ -223,13 +223,7 @@
                                     "src": item.previewUrl,
                                     "type": "rtmp/flv"
                                 }
-                            ],
-                            techOrder: ['flash'],
-                            autoplay: true,
-                            controls: false,
-                            fluid: true,
-                            preload: 'auto',
-                            notSupportedMessage: '此视频暂无法播放,请稍后再试',
+                            ]
                         }
                     }
                     this.videoPlayObj = videoPlayObj

+ 8 - 18
src/renderer/components/SignalList.vue

@@ -33,12 +33,13 @@
         >
             <div class="signal_item_bg">
                 <div class="signal_item_bg_body">
-                    <div v-show="item.preview" class="signal_item_bg_body_space">
-                        <VideoPlayer
-                                :options="videoPlayObj2[item.sourceId]"
-                                :playsinline="true"
-                                :ref="item.ID"
-                        />
+                    <div class="signal_item_bg_body_space">
+                        <div v-show="item.preview" :ref="item.ID">
+                            <VideoPlayer
+                                    :options="videoPlayObj2[item.sourceId]"
+                                    :playsinline="true"
+                            />
+                        </div>
                     </div>
                     <div class="signal_item_bg_body_font">{{item.deviceName}}</div>
                 </div>
@@ -80,23 +81,12 @@
                             "src": item.previewUrl,
                             "type": "rtmp/flv"
                         }
-                    ],
-                    techOrder: ['html5','flash'],
-                    autoplay: true,
-                    muted: true, // 是否静音
-                    controls: false,
-                    fluid: true,
-                    preload: 'auto',
-                    notSupportedMessage: '此视频暂无法播放,请稍后再试',
+                    ]
                 }
             }
             this.videoPlayObj2 = videoPlayObj2
         },
 
-        mounted() {
-
-        },
-
         updated() {
             const flag = this.signalBorder[0] ? (this.signalBorder[0].Orientation === 0 ? 'column' : 'row') : ''
             if (flag === 'column') {

+ 8 - 18
src/renderer/components/player.vue

@@ -14,6 +14,7 @@
   // lib
   import _videojs from 'video.js'
   const videojs = window.videojs || _videojs
+  import "video.js/dist/video-js.css"
   import "videojs-flash"
 
   // pollfill
@@ -85,23 +86,13 @@
       globalOptions: {
         type: Object,
         default: () => ({
-          // autoplay: false,
-          controls: true,
-          // preload: 'auto',
-          // fluid: false,
-          // muted: false,
-          controlBar: {
-            remainingTimeDisplay: false,
-            playToggle: {},
-            progressControl: {},
-            fullscreenToggle: {},
-            volumeMenuButton: {
-              inline: false,
-              vertical: true
-            }
-          },
-          techOrder: ['html5'],
-          plugins: {}
+          techOrder: ['flash','html5'],
+          autoplay: true,
+          muted: true,
+          controls: false,
+          fluid: true,
+          preload: 'auto',
+          notSupportedMessage: '此视频暂无法播放,请稍后再试',
         })
       },
       globalEvents: {
@@ -122,7 +113,6 @@
     },
     beforeDestroy() {
       // if (this.player.techName_ !== 'Flash' && this.player.pause) { this.player.pause() }
-
       const videoDom = this.$refs.video
       videojs(videoDom).dispose()
       if (this.player) {