Skip to content

Commit

Permalink
add help button for how to pop out video in firefox (#9298)
Browse files Browse the repository at this point in the history
* add help button for how to pop out video in firefox

* change back to 'Pop out video'
  • Loading branch information
jwunderl authored Jan 19, 2023
1 parent 1347aff commit 7ef8a60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webapp/src/marked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,18 @@ export class MarkedContent extends data.Component<MarkedContentProps, MarkedCont
pipButton.textContent = lf("Pop out video");
pipButton.ariaLabel = lf("Open video in picture-in-picture mode");
pipButton.title = pipButton.ariaLabel;
} else if (pxt.BrowserUtils.isFirefox()) {
const pipInstructionButton = document.createElement("button");
inlineVideo.parentElement.appendChild(pipInstructionButton);
pipInstructionButton.addEventListener("click", () => {
pxt.tickEvent("video.pip.firefoxHelp");
window.open("/firefox-picture-in-picture", "_blank");
});
pipInstructionButton.addEventListener("keydown", e => fireClickOnEnter(e as any));
pipInstructionButton.className = "common-button";
pipInstructionButton.textContent = lf("Pop out video");
pipInstructionButton.ariaLabel = lf("Instructions on how to open video in picture-in-picture mode");
pipInstructionButton.title = pipInstructionButton.ariaLabel;
}

player.on(dashjs.MediaPlayer.events.PLAYBACK_STARTED,
Expand Down

0 comments on commit 7ef8a60

Please sign in to comment.