2

I cannot find a way to have a video embedded on website and have it play fullscreen when the end user presses the play button, using the YouTube iFrame Player API... This is a big issue on mobile as the video is just too small on the page and has to be started fullscreen to make any sense.

Note that the div #player is in a modal window

Html:

 <div id="player"></div>

JS:

  var player = new YT.Player('player', {   
      width: '100%',
      height: '100%',
      videoId: 'some_video_id',        
      playerVars: {
          enablejsapi: 1,
          playsinline: 1,
          controls: 0,
          rel: 0,
          origin: window.location.origin,
          widget_referrer: window.location.origin 
        }
    });  

How do I have the player start fullscreen using the API ?? Absolute madness I have to ask this in (soon) 2023... There does not seem to be any parameter for this in the documentation

Eric
  • 9,870
  • 14
  • 66
  • 102

0 Answers0