movie-web/src/components/video/hooks/controlVideo.ts

21 lines
343 B
TypeScript
Raw Normal View History

2023-01-08 15:37:16 +01:00
export interface PlayerControls {
play(): void;
pause(): void;
}
export const initialControls: PlayerControls = {
play: () => null,
pause: () => null,
};
export function populateControls(player: HTMLVideoElement): PlayerControls {
return {
play() {
player.play();
},
pause() {
player.pause();
},
};
}