Skip to content

Commit

Permalink
return video component as is
Browse files Browse the repository at this point in the history
  • Loading branch information
stCarolas committed May 11, 2024
1 parent 68bbac1 commit 39b81bf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/components/MediaWidget/VideoJSComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ let options: VideoJsPlayerOptions = {
youtube: { ytControls: 0, rel: 0 },
};

let freezed = false;

enum PLAYER_STATE {
PLAYING,
PAUSED,
Expand Down Expand Up @@ -60,16 +58,14 @@ export default function VideoJSComponent({

function freeze() {
log.debug(`freezing player`);
freezed = true;
pausedByCommand.current = true;
if (player && !player.paused()) {
pausedByCommand.current = true;
player.pause();
}
}

function unfreeze() {
log.debug(`unfreezing player`);
freezed = false;
if (!player) {
log.debug(`cancel unfreeze because of missing player`);
return;
Expand Down Expand Up @@ -151,7 +147,6 @@ export default function VideoJSComponent({
videoElement.classList.add("vjs-big-play-centered");
videoRef.current?.appendChild(videoElement);
options.sources = song;
options.autoplay = !freezed;
log.debug({options: options}, "creating player with options");

const player = videojs(videoElement, options);
Expand Down

0 comments on commit 39b81bf

Please sign in to comment.