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

Play back HLS if possible, if not fall back to single rate HTTP


I'm working with the enterprise player and trying to get the player to always play HLS if possible (either in Flash or HTML5 native), and if that's not available, then play the fallback single rate HTTP file.

If I leave the "primary" option set to "html5", the player will never use the HLS source on browsers that don't support HLS native, even though they could play HLS in flash. For example, Chrome web browser can't play HLS in HTML5 native, but it CAN play it in flash, but the player would always skip over HLS in this case.

If I instead set the "primary" option to "flash", then things work a bit better, but still not ideal. For example, when viewing a player with that configuration on Safari + Mac, which can play HLS natively, the player attempts to load the flash player. If the user has an out of date Flash version on their machine, then they get a warning to update flash instead of the player falling back to native HLS.

Does anyone have any recommendations here? To re-iterate: My goal is to attempt to play HLS whenever possible, whether it be through HTML5 native of Flash. If that's not possible, then fall back to the single rate HTTP source.

Here's a web page with two identical players, one with "primary" set to "flash" and the other with it set to "html5": http://webtest.telvue.com/jw6/

2 Community Answers

jherrieven

User  
0 rated :

You could set your "primary" parameter to be conditional:

"primary":(jwplayer.utils.isSafari()?'html5':'flash')

James Herrieven

Andrew

JW Player Support Agent  
0 rated :

Yup, I’d go with James’ suggestion here. If primary rendering is the only thing that will change based on browser selection, this should be all that’s needed

This question has received the maximum number of answers.