stream/assets/js/video-controls.js

16 lines
316 B
JavaScript
Raw Normal View History

2021-03-04 23:10:20 +00:00
export const toggleVideoPlaying = ({ player, video, onPlay, onPause }) => {
console.log('video', video);
if (video.isPlaying) {
player.pause();
if (typeof onPause === 'function') {
onPause();
}
} else {
player.play();
if (typeof onPlay === 'function') {
onPlay();
}
}
};