mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 07:47:32 +09:00
more PiP fixes
This commit is contained in:
parent
2ebf29a6aa
commit
aac2156499
6 changed files with 56 additions and 7 deletions
|
|
@ -11,6 +11,7 @@ var output = null;
|
|||
var still = null;
|
||||
var observer = null;
|
||||
var sourceWindow = null;
|
||||
var initialized = false;
|
||||
var events = ["play", "pause", "volumechange", "ended", "seeked", "resize"];
|
||||
|
||||
function update() {
|
||||
|
|
@ -63,6 +64,12 @@ function closePlayer() {
|
|||
}
|
||||
|
||||
addMessageListener("PictureInPicture:Init", message => {
|
||||
// takeSource consumes the handoff. A duplicate initialization must not
|
||||
// consume it again or close an already playing window.
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
try {
|
||||
source = PictureInPicture.takeSource(message.data.id);
|
||||
sourceWindow = source.ownerGlobal;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue