|
|
|
@ -859,6 +859,22 @@ export class AppMediaPlaybackController {
@@ -859,6 +859,22 @@ export class AppMediaPlaybackController {
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
if(media) this.setMedia(media, message); |
|
|
|
|
else this.playingMedia = undefined; |
|
|
|
@ -881,6 +897,10 @@ export class AppMediaPlaybackController {
@@ -881,6 +897,10 @@ export class AppMediaPlaybackController {
|
|
|
|
|
this.playingMediaType = undefined; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(media) { |
|
|
|
|
media.removeEventListener('play', onPlay); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// I don't remember what it was for
|
|
|
|
|
// if(media && this.playingMedia === media) {
|
|
|
|
|
// this.stop();
|
|
|
|
|