Replace manual events with vidstack media gestures

thrimbletrimmer-solid
ElementalAlchemist 7 days ago
parent 106cd21215
commit 9c97b564c7

@ -9,6 +9,15 @@ media-player {
align-items: normal;
}
media-gesture {
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
// Used to make the controls appear below the video player
media-player:not([data-fullscreen]) media-controls {
position: relative;

@ -246,16 +246,9 @@ export const VideoPlayer: Component<VideoPlayerProps> = (props) => {
preload="auto"
storage="thrimbletrimmer"
>
<media-provider
onClick={(event) => {
const player = props.mediaPlayer();
if (player.paused) {
player.play(event);
} else {
player.pause(event);
}
}}
/>
<media-provider />
<media-gesture event="pointerup" action="toggle:paused" />
<media-gesture event="dblpointerup" action="toggle:fullscreen" />
<media-captions class="vds-captions" />
<media-controls class="vds-controls" hideDelay={0}>
<media-controls-group class="vds-controls-group">

Loading…
Cancel
Save