大华大屏
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
|   <div class="dh-video"> | ||||
|   <div class="dh-video" style="height: 100%;"> | ||||
|     <video :id="id" autoplay class="video-js vjs-default-skin" style="width: 100%; height: 100%;" controls> | ||||
|       <source :src="src"> | ||||
|     </video> | ||||
| @@ -16,7 +16,8 @@ | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         id: `video-${Math.ceil(Math.random() * 10000)}` | ||||
|         isInit: false, | ||||
|         id: `video-${Math.ceil(Math.random() * 1000000)}` | ||||
|       } | ||||
|     }, | ||||
|  | ||||
| @@ -31,6 +32,7 @@ | ||||
|             }) | ||||
|           } | ||||
|         }, | ||||
|         immediate: true, | ||||
|         deep: true | ||||
|       } | ||||
|     }, | ||||
| @@ -40,7 +42,10 @@ | ||||
|         this.$nextTick(() => { | ||||
|            videojs(this.id, { | ||||
|             autoplay: true | ||||
|           }, function () { console.log('videojs播放器初始化成功') }) | ||||
|           }, function () { | ||||
|             this.isInit = true | ||||
|             console.log('videojs播放器初始化成功') | ||||
|           }) | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user