Search code examples
cssreactjsfullscreenvideo-playershaka

Shaka-Player start fullscreen


Context: Currently I'm making a demo project with the intention of finding out if Shaka-Player could be viable option for us in the future. For the purposes of the project I'm unable to use the standard controls, because we use custom controls. The project is being developed in Reactjs.

Question: How am I supposed to get the Shaka-Player to start from Fullscreen without using the standard "controls - fullscreen" way?

Thanks in advance!


Solution

  • Toggle fullscreen on shaka player by calling .requestFullscreen() on the video element.

    *Side note since you mentioned you are using custom controls:

    According to this issue, fullscreening a video element in Chrome forces the browser-native video controls. The suggested workaround for this issue is to fullscreen the element that contains your video element and controls.