Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add help button for how to pop out video in firefox #9298

Merged
merged 2 commits into from
Jan 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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