修复大华视频播放

This commit is contained in:
aixianling
2022-08-12 11:50:04 +08:00
parent 98946c1e28
commit 38d01b37fd
5 changed files with 16 additions and 17 deletions

View File

@@ -21,13 +21,12 @@ export default {
const promise = url => new Promise(resolve => this.$injectLib(url, () => resolve())),
promiseCss = url => new Promise(resolve => this.$injectCss(url, () => resolve()))
return Promise.all([
promiseCss("//cdn.cunwuyun.cn/videojs/video-js.min.css"),
promise("//cdn.cunwuyun.cn/videojs/video.min.js"),
promise("//cdn.cunwuyun.cn/videojs/videojs-contrib-hls.js"),
])
promiseCss("https://cdn.cunwuyun.cn/videojs/video-js.min.css"),
promise("https://cdn.cunwuyun.cn/videojs/video.min.js"),
]).then(() => promise("https://cdn.cunwuyun.cn/videojs/videojs-contrib-hls.js"))
},
initVideoJs(count = 0) {
if (!!videojs) {
if (!!window.videojs) {
videojs(this.id, {
autoplay: true
}, function () {
@@ -42,16 +41,13 @@ export default {
src: {
handler(val) {
if (val) {
this.initVideoJs()
this.loadLib().then(() => this.initVideoJs())
}
},
immediate: true,
deep: true
}
},
created() {
this.loadLib()
},
}
}
</script>