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

If no hls / m3ub available (accessDenied) play mp4 fallback


Is there a way that I can have my fallback mp4 play when the hls stream url throws an error like this:

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>681FDSF1D4D4</RequestId>
<HostId>
enbsr5W6WBOYUCHw432jkfslsup9jH9PsfsfZKtFMfZ0vCtP0+pNKFZWQCu
</HostId>
</Error>

Not sure if it matters, but this file is in an Amazon s3 bucket

5 Community Answers

mark

User  
0 rated :

Why not just fix the problem rather than going to fallback?
Your problem is permissions or CORS or crossdomain.xml not setup
I can help if you show me your page and your crossdomain file and cors settings

Alex

JW Player Support Agent  
1 rated :

Hi, there.

You can set up multiple sources for our player by following the steps on our Configuring Multiple Sources support article. The player will try to play the first source, then if it cannot play that file, it will move on to the second.

However, Mark is right. Your issue is most likely CORS related, meaning that the S3 bucket your video is on is not allowing your domain access to it. You can resolve this by checking out our Crossdomain File Loading support article.

Please let me know if you need any more help or have any other questions.

Thank you!

accounting

User  
0 rated :

I will look into the crossdomain file loading, but how come my fallback playback format isn't being used when the first video isn't accessible? This is only happening on iPhone and Android devices, and also on the new Microsoft Edge browser. Here is my setup:

jwplayer('mediaplayer').setup({
'width': '100%',
'sources': [{
file: 'http://d1dh1eq94v8p9i.cloudfront.net/user_10/1444239612_uploadVideomp/playlist.m3u8' // hls as default playback format
},{
file: 'https://s3.amazonaws.com/domain/user_10/1444239612_uploadVideomp.mp4 ' // fallback format
}],
'rtmp': {
'bufferlength': '30'
},
'smoothing':'false',
"aspectratio": "16:9",
"image": "https://s3.amazonaws.com/domain/user_10/1444239612_uploadVideomp.png",
'autostart': 'true',
'primary': 'html5',
'modes': [
{ type: 'html5' },
{ type: 'flash', src: 'http://www.domain.com/js/jwplayer.flash.swf' }
]


});

mark

User  
0 rated :

Fallback is for videos that the browser recognises are not supported, for example, HLS on Firefox where there is no flash player installed. It does not fallback when a file is specified that receives a 404 response.

Alex

JW Player Support Agent  
0 rated :

Correct – if a file gives the player an actual error, such as a CORS-related error, or its not found, then the player will not fallback.

In your case, I’m actually receiving CORS-related errors on both your HLS and MP4 sources in Chrome for OS X. Also, it is not suggested to mix HTTP and HTTPS sources, as they may cause issues in some browsers.

Thanks.

This question has received the maximum number of answers.