Skip to content

Commit

Permalink
Merge pull request #322 from StephenMcConnel/BL-12299-EnableReplayBut…
Browse files Browse the repository at this point in the history
…tons

Ensure replay buttons work reliably (follow up BL-12299)
  • Loading branch information
andrew-polk authored Sep 19, 2024
2 parents c43c029 + ec60c3e commit f9082b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bloom-player-core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,14 +1008,19 @@ export class BloomPlayerCore extends React.Component<IProps, IState> {
}

private showReplayButton(pageVideoData: IPageVideoComplete | undefined) {
const pageNumber =
pageVideoData?.page.getAttribute("data-page-number") ?? 0;
pageVideoData?.videos.forEach((video, index) => {
const parent = video.parentElement!;
let replayButton = document.getElementById(
`replay-button-${index}`
`replay-button-${pageNumber}-${index}`
);
if (!replayButton) {
replayButton = document.createElement("div");
replayButton.setAttribute("id", `replay-button-${index}`);
replayButton.setAttribute(
"id",
`replay-button-${pageNumber}-${index}`
);
replayButton.classList.add("replay-button");
replayButton.style.position = "absolute";
replayButton.style.display = "none";
Expand Down

0 comments on commit f9082b5

Please sign in to comment.