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
|
||||
event.preventDefault()
|
||||
// Toggle Picture in Picture Mode
|
||||
if (!this.player.isInPictureInPicture()) {
|
||||
if (this.format !== 'audio' && !this.player.isInPictureInPicture()) {
|
||||
this.player.requestPictureInPicture()
|
||||
} else if (this.player.isInPictureInPicture()) {
|
||||
this.player.exitPictureInPicture()
|
||||
|
|
|
@ -75,7 +75,8 @@ export default Vue.extend({
|
|||
playlistId: '',
|
||||
timestamp: null,
|
||||
playNextTimeout: null,
|
||||
playNextCountDownIntervalId: null
|
||||
playNextCountDownIntervalId: null,
|
||||
pictureInPictureButtonInverval: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -174,6 +175,21 @@ export default Vue.extend({
|
|||
}
|
||||
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 () {
|
||||
|
|
Loading…
Reference in New Issue