Restrict playing pip and video in viewer together
This commit is contained in:
parent
cd338e0596
commit
ed8d2eadc4
@ -859,6 +859,22 @@ export class AppMediaPlaybackController {
|
|||||||
|
|
||||||
const wasPlaying = this.pause();
|
const wasPlaying = this.pause();
|
||||||
|
|
||||||
|
let onPlay: () => void;
|
||||||
|
if(media) {
|
||||||
|
onPlay = () => {
|
||||||
|
const pip = this.pip;
|
||||||
|
if(pip) {
|
||||||
|
pip.pause();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if(!media.paused) {
|
||||||
|
onPlay();
|
||||||
|
}
|
||||||
|
|
||||||
|
media.addEventListener('play', onPlay);
|
||||||
|
}
|
||||||
|
|
||||||
this.willBePlayed(undefined);
|
this.willBePlayed(undefined);
|
||||||
if(media) this.setMedia(media, message);
|
if(media) this.setMedia(media, message);
|
||||||
else this.playingMedia = undefined;
|
else this.playingMedia = undefined;
|
||||||
@ -881,6 +897,10 @@ export class AppMediaPlaybackController {
|
|||||||
this.playingMediaType = undefined;
|
this.playingMediaType = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(media) {
|
||||||
|
media.removeEventListener('play', onPlay);
|
||||||
|
}
|
||||||
|
|
||||||
// I don't remember what it was for
|
// I don't remember what it was for
|
||||||
// if(media && this.playingMedia === media) {
|
// if(media && this.playingMedia === media) {
|
||||||
// this.stop();
|
// this.stop();
|
||||||
|
@ -174,7 +174,7 @@ export default class VideoPlayer extends ControlsHover {
|
|||||||
});
|
});
|
||||||
|
|
||||||
listenerSetter.add(document)('keydown', (e: KeyboardEvent) => {
|
listenerSetter.add(document)('keydown', (e: KeyboardEvent) => {
|
||||||
if(rootScope.overlaysActive > 1 || document.pictureInPictureElement) { // forward popup is active, etc
|
if(rootScope.overlaysActive > 1 || document.pictureInPictureElement === video) { // forward popup is active, etc
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user