Skip to content

Commit

Permalink
fix: add workaround for issue with restoreel option in video.js
Browse files Browse the repository at this point in the history
Added a div container to ensure that the parent of the element passed to video.js is not
the shadow root directly. This workaround resolves the issue until a permanent fix is
implemented in video-js, see: videojs/video.js#8679
  • Loading branch information
jboix committed Apr 10, 2024
1 parent 4d8f5f5 commit cd68344
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/components/preview-box.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, LitElement } from 'lit';
import { css, html, LitElement } from 'lit';
import pillarbox from '@srgssr/pillarbox-web';

/**
Expand All @@ -22,19 +22,29 @@ class PreviewBox extends LitElement {
type: { type: String }
};

static styles = css`
.player-container {
width: 100%;
height: 100%;
}
`;

constructor() {
super();
this.src = 'urn:rts:video:14318206';
this.type = 'srgssr/urn';
}

render() {
// TODO Remove the player container once this is resolved: https://github.com/videojs/video.js/pull/8679
return html`
<style>${this.appliedCss}</style>
<video id="preview-player"
class="pillarbox-js"
controls crossOrigin="anonymous">
</video>
<div class="player-container">
<video id="preview-player"
class="pillarbox-js"
controls crossOrigin="anonymous">
</video>
</div>
`;
}

Expand Down

0 comments on commit cd68344

Please sign in to comment.