Skip to content

Commit

Permalink
remove the autoplay for 1 second to show frame as unneeded (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv authored Jan 15, 2025
1 parent 18087d9 commit 9a08643
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class MediaElementCenterPanel extends CenterPanel<
});

this.extensionHost.subscribe(IIIFEvents.SET_TARGET, (target: TFragment) => {

// Clear any existing timeout
if (that.pauseTimeoutId !== null) {
clearTimeout(that.pauseTimeoutId);
Expand Down Expand Up @@ -98,17 +97,10 @@ export class MediaElementCenterPanel extends CenterPanel<
}
}

that.player.setCurrentTime(t);

if (that.config.options.autoPlayOnSetTarget) {
that.player.setCurrentTime(t);
that.player.play();
} else {
// need to play first to show the frame
that.player.setCurrentTime(t);
that.player.play();
setTimeout(() => {
that.player.pause();
that.player.setCurrentTime(t);
}, 1000);
}
});

Expand Down

0 comments on commit 9a08643

Please sign in to comment.