提交 46d5287a authored 作者: pengxiaohui's avatar pengxiaohui

修复视频多次切换播放失效的bug

上级 44dece05
...@@ -15,19 +15,24 @@ export default { ...@@ -15,19 +15,24 @@ export default {
}, },
data() { data() {
return { return {
player: null
} }
}, },
mounted() { mounted() {
const url = this.info.url const url = this.info.url
setTimeout(() => { setTimeout(() => {
const player = window.videojs('videoPlayer') this.player = window.videojs('videoPlayer')
player.src({ this.player.src({
src: url, src: url,
type: 'application/x-mpegURL' type: 'application/x-mpegURL'
// withCredentials: true // withCredentials: true
}) })
player.play() console.log(123)
this.player.play()
}, 300) }, 300)
},
beforeDestroy() {
this.player.dispose()
} }
} }
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论