|
@@ -4,9 +4,7 @@
|
|
|
|
|
|
|
|
<div class="loadingError" v-if="isVideoLoadingFailed">视频加载失败</div>
|
|
<div class="loadingError" v-if="isVideoLoadingFailed">视频加载失败</div>
|
|
|
|
|
|
|
|
- <video v-loading="true" ref="videoRef" autoplay muted class="video-js video-content">
|
|
|
|
|
- <source :src="props.url" />
|
|
|
|
|
- </video>
|
|
|
|
|
|
|
+ <video v-loading="true" ref="videoRef" autoplay muted class="video-js video-content"></video>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -65,7 +63,7 @@
|
|
|
videoElement.removeEventListener('timeupdate', handleTimeUpdate);
|
|
videoElement.removeEventListener('timeupdate', handleTimeUpdate);
|
|
|
videoElement.addEventListener('timeupdate', handleTimeUpdate);
|
|
videoElement.addEventListener('timeupdate', handleTimeUpdate);
|
|
|
|
|
|
|
|
- player.attachMediaElement(videoElement);
|
|
|
|
|
|
|
+ player.attachMediaElement(videoElement as HTMLVideoElement);
|
|
|
player.load();
|
|
player.load();
|
|
|
player.on(mpegts.Events.MEDIA_INFO, () => {
|
|
player.on(mpegts.Events.MEDIA_INFO, () => {
|
|
|
console.log('视频开始播放');
|
|
console.log('视频开始播放');
|