Is there a way to play a video fullscreen using the HTML5 <video>
tag?
And if this is not possible, does anybody know if there is a reason for this decision?
fullscreenhtmlhtml5-videovideo
Is there a way to play a video fullscreen using the HTML5 <video>
tag?
And if this is not possible, does anybody know if there is a reason for this decision?
Best Answer
2020 answer
HTML 5 provides no way to make a video fullscreen, but the parallel Fullscreen API defines an API for elements to display themselves fullscreen.
This can be applied to any element, including videos.
Browser support is good, but Internet Explorer and Safari need prefixed versions.
An external demo is provided as Stack Snippet sandboxing rules break it.
2012 answer
HTML 5 provides no way to make a video fullscreen, but the parallel Fullscreen specification supplies the
requestFullScreen
method which allows arbitrary elements (including<video>
elements) to be made fullscreen.It has experimental support in a number of browsers.
2009 answer
Note: this has since been removed from the specification.
From the HTML5 spec (at the time of writing: June '09):
Browsers may provide a user interface, but shouldn't provide a programmable one.