DEV Community

Discussion on: How to Create a Video Player in React

Collapse
 
nosovandrew profile image
Andrew Nosov

Hi! You can make it by adding to useVideoPlayer hook following func:

const toggleFullscreen = () => {
    if (videoElement.current) {
            videoElement.current.requestFullscreen();
    }
}
Enter fullscreen mode Exit fullscreen mode

Then you can run this func by clicking on the desired icon.