修复大华视频播放
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user