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/

1 Community Answers

Carolyn Ganon

JW Player Support Agent  
0 rated :

Hello,

If your goal is to have the user play m3u8 natively if possible and in flash if not possible, you have two options:

1) You can simply remove your fallback file and set the primary to html5. In Safari, the browser will automatically play the file natively. In all other browsers, the player will recognize that there is a m3u8 file that can’t be played through html5 and gracefully revert to the flash player.

2) If you want to keep the fallback, you can use user-agent detection to force the playlistItem that is compatible with the player onReady. You can check out all our Javascript API callback events here: http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference

Hope this helps! Let me know if you have any more questions.

Best,

Carolyn Ganon
Customer Support Engineer
JW Player

This question has received the maximum number of answers.