Hide Picture in Picture button and disable shortcut for audio formats (#2227)
This commit is contained in:
parent
cce529172b
commit
1e5895a8c6
|
@ -1578,7 +1578,7 @@ export default Vue.extend({
|
||||||
// I Key
|
// I Key
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
// Toggle Picture in Picture Mode
|
// Toggle Picture in Picture Mode
|
||||||
if (!this.player.isInPictureInPicture()) {
|
if (this.format !== 'audio' && !this.player.isInPictureInPicture()) {
|
||||||
this.player.requestPictureInPicture()
|
this.player.requestPictureInPicture()
|
||||||
} else if (this.player.isInPictureInPicture()) {
|
} else if (this.player.isInPictureInPicture()) {
|
||||||
this.player.exitPictureInPicture()
|
this.player.exitPictureInPicture()
|
||||||
|
|
|
@ -75,7 +75,8 @@ export default Vue.extend({
|
||||||
playlistId: '',
|
playlistId: '',
|
||||||
timestamp: null,
|
timestamp: null,
|
||||||
playNextTimeout: null,
|
playNextTimeout: null,
|
||||||
playNextCountDownIntervalId: null
|
playNextCountDownIntervalId: null,
|
||||||
|
pictureInPictureButtonInverval: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -174,6 +175,21 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
activeFormat: function (format) {
|
||||||
|
clearInterval(this.pictureInPictureButtonInverval)
|
||||||
|
|
||||||
|
// only hide/show the button once the player is available
|
||||||
|
this.pictureInPictureButtonInverval = setInterval(() => {
|
||||||
|
if (!this.hidePlayer) {
|
||||||
|
if (format === 'audio') {
|
||||||
|
document.querySelector('.vjs-picture-in-picture-control').classList.add('vjs-hidden')
|
||||||
|
} else {
|
||||||
|
document.querySelector('.vjs-picture-in-picture-control').classList.remove('vjs-hidden')
|
||||||
|
}
|
||||||
|
clearInterval(this.pictureInPictureButtonInverval)
|
||||||
|
}
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
|
Loading…
Reference in New Issue