On OSX Safari, HTML5 video tag when clicking on fullscreen. How can I force the video to cover the full screen instead of showing a small (maybe the original) size with a black background?
Works great on most browsers when clicking fullscreen exept for Safari on OSX.
– JackDec 12 '14 at 21:54
I have the same issue, my code is similar to the one of @TheCrazyProfessor answer and I have the `max-height` as suggested by @Jack but still have the same issue. Did you find a working answer ?
– gervais.bApr 14 '20 at 10:13
2 Answers2
5
Ok, found it. Need some CSS when a max-height is set. Answer:
As @Jack say we need to use the CSS -webkit-full-screen
I think you wanna have you're own customized controller right? In that case, we need to put the control panel and the video inside a div, and use the full-screen on that. Let's us just call it videoContainer
First we make the HTML
<div class="videoContainer">
<video id="video" allowfullscreen="allow">
<source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<p>Your browser does not support the video tag.</p>
</video>
<!-- Control -->
<div class="control">
<a class="play mediaplayer-play"></a>
<a class="fullscreen mediaplayer-full-screen"></a>
</div>
</div>