Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Request Fullscreen in HTML5


How do I get JW Player to go fullscreen when the onPlay or onBeforePlay event is fired in HTML5 mode? I know how to do this using the basic HTML5 video tag, but I can't get it to work with JW. Basically, I'm trying to get the player to go fullscreen on Android phones when it starts playing, similar to how it does on iPhones.

5 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference

Resize

These API calls are used to retrieve and update the current player dimensions and fullscreen state. Note there is no API call to set fullscreen, due to phishing-related security restrictions in both Flash and HTML5.

kenny

User  
0 rated :

What's the proper syntax for 100% width resize? When I put in jwplayer().resize(100%) it breaks my code.

Ethan Feldman

JW Player Support Agent  
0 rated :

Email me, I have a small demo that does this, it uses some css though.

kenny

User  
0 rated :

I got this working for anybody who is wondering the same thing I am. I found a handy project on GitHub called Screenfull.

https://github.com/sindresorhus/screenfull.js/

Download the script and put it in your header...

<script src="pathtoscript/screenfull.min.js"></script>

And here's the javascript I used to get this to work on Android. It works in Chrome for Android on 4.4. Haven't tested anything else yet.

jwplayer().onBeforePlay(function(event) {
var elem = document.getElementById('player');
screenfull.request(elem);
});

Ethan Feldman

JW Player Support Agent  
0 rated :

That is cool, thanks for sharing.

This question has received the maximum number of answers.