Youtube videos do not open on full screen

Asked

Viewed 246 times

3

Galera would have like through some javascript to make a video on my site not open on full screen on iOS devices?

Because I’m using youtube as a music player and every time someone accesses on iOS devices it opens the video on full screen. Follow my code with playsinline.

var buildPlayer = function(videoUrl)
{
     playerLoading = true;

     player = new YT.Player(attrs.container, {
         height: '200',
         width: '200',
         videoId: getIdFromUrl(videoUrl),
         playerVars: {
             enablejsapi: 1,
             playsinline: 1,
             html5: 1,
         },
         events: {
             'onReady': onPlayerReady,
             'onStateChange': onStateChange
         }
     });
}
  • Can you put a reproducible example? I want to test but I don’t have a complete example.

  • 1

    Can I guess iOS only opens in fullscreen anyway, after all it runs with the "native player". This could be a youtube BUG, because in the apple https://developer.apple.com/library/iad/documentation/UserExperience/Conceptual/iAdJSProgGuide/PlayingVideosinAds/PlayingVideosinAds.html says it works for "ads".

1 answer

0

  • I did as you said about playsinline but it keeps opening in full screen. I modified the question.

  • In fact it is the opposite, the value 0 is what makes it able to display in full screen "0: this value causes the playback to be done in full screen. It is currently the default value, although the default is subject to changes."

Browser other questions tagged

You are not signed in. Login or sign up in order to post.