Fullscreen HTML5 Video in Safari via JavaScript

In Safari 5 HTML5 videos played in the <video> tag can now be made fullscreen, if you're using the default controls then a button is available, but if you're overriding them with a custom control you can use:

  1. webkitEnterFullScreen();

This needs to be called on the video tag element, for example, to fullscreen the first video tag on the page use:

  1. document.getElementsByTagName('video')[0].webkitEnterFullscreen();

One thought on “Fullscreen HTML5 Video in Safari via JavaScript

  1. Hi I’m trying to apply the code to my .html page but it seems that i’m missing something.

    I hope you can help me
    Sincerely

    Jim

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>