修复集成新版本Jessibuca后的播放问题

This commit is contained in:
lin
2025-10-26 21:15:44 +08:00
parent d117a0d83a
commit d6042c4e16
2 changed files with 23 additions and 36 deletions

View File

@@ -54,29 +54,13 @@ export default {
forceNoOffscreen: false
}
},
watch: {
// videoUrl: {
// handler(val, _) {
// if (typeof val !== 'undefined' && val !== 'undefined') {
// console.log(22222111)
// console.log(val)
// this.$nextTick(() => {
//
// this.play(val)
// })
// }
// },
// immediate: true
// }
},
created() {
const paramUrl = decodeURIComponent(this.$route.params.url)
this.$nextTick(() => {
if (typeof (this.videoUrl) === 'undefined' || typeof (paramUrl) !== 'undefined') {
console.log(paramUrl)
if (!this.videoUrl && paramUrl) {
this.videoUrl = paramUrl
}
this.btnDom = document.getElementById('buttonsBox')
})
},
mounted() {},
destroyed() {
@@ -94,8 +78,6 @@ export default {
if (jessibucaPlayer[this._uid]) {
jessibucaPlayer[this._uid].destroy()
}
console.log(1111)
console.log(this.$refs.container.dataset['jessibuca'])
if (this.$refs.container.dataset['jessibuca']) {
this.$refs.container.dataset['jessibuca'] = undefined
}
@@ -214,16 +196,15 @@ export default {
this.quieting = jessibuca.quieting
})
},
playBtnClick: function(event) {
playBtnClick: function() {
this.play(this.videoUrl)
},
play: function(url) {
this.videoUrl = url
console.log('Jessibuca -> url: ', url)
if (jessibucaPlayer[this._uid]) {
this.destroy()
}
if (!jessibucaPlayer[this._uid]) {
this.create()
this.$nextTick(() => {
}
jessibucaPlayer[this._uid].play(url)
if (jessibucaPlayer[this._uid].hasLoaded()) {
@@ -233,7 +214,6 @@ export default {
// jessibucaPlayer[this._uid].play(url)
})
}
})
},
pause: function() {

View File

@@ -425,6 +425,13 @@ export default {
console.log(this.player[tab.name][0])
this.activePlayer = tab.name
this.videoUrl = this.getUrlByStreamInfo()
if (this.$refs[this.activePlayer]) {
this.$refs[this.activePlayer].play(this.videoUrl)
} else {
this.$nextTick(() => {
this.$refs[this.activePlayer].play(this.videoUrl)
})
}
},
openDialog: function(tab, deviceId, channelId, param) {
if (this.showVideoDialog) {