1
votes

What does iPhone use to play Youtube videos on browser?

I know that <video> tag uses native quick time to play videos. Then I know that iPhone doesn't support flash so it can't play YouTube video directly. I used this videojs-youtube library to embed the YouTube video using it's url and this is the result html elements:

<div>
  <iframe>
    #document
  </iframe>
</div>

Inside the #document is a whole new html of the actual youtube video. If it doesn't support flash, what technology does it use to play the video even if the code is using an iframe element?

Also, is there a way to/how do I programatically close (via javascript) the YouTube video from full screen?

1
Please see edited question. Thanks!MoMo

1 Answers

0
votes

Youtube uses an iframe to serve up it's video content. If it detects you cannot handle flash, it will fall back to HTML5 Video. Most mobile browsers including iPhones can handle HTML 5 video. In Youtube's case, it shows a thumbnail of the video in the iframe with a play button. You click it to load the html5 video. The iPhone plays all video in it's native player.

There is no way to close a video from fullscreen within the iphone, but in normal browsers, you can go out of fullscreen in video js by calling NAME_OF_YOUR_PLAYER.exitFullScreen();