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

Can JWPlayer fallback to HTTP streaming (VOD) if the RTMP server is unavailable


I have configured JWPlayer will multiple sources such that it has both RTMP (flash) and HTTP URL's. The RTMP url's point to a WOWZA media server while the HTTP URL's point to NGINX. I want the playback to be done via RTMP preferably, but if the RTMP server is unavailable then can it pick the next URL from the source list?

In addition, my understanding is that if the RTMP URL is not playable on a device (e.g. IPAd), it will automatically fallback to the http url? Is that correct?

E.g Here are asome of the URL's that I use

'rtmp://localhost:1935/EmyEd/flv:/secured/videos/lnora/72/5e0/9a2-011c-4421-9e38-ba34ac89ac08.MPG',
'http://localhost:8090/secured/videos/lnora/72/5e0/9a2-011c-4421-9e38-ba34ac89ac08.MPG,
'rtmp://localhost:1935/EmyEd/flv:/secured/videos/lnora/72/5e0/9a2-011c-4421-9e38-ba34ac89ac08_playback.flv',
'http://localhost:8090/secured/videos/lnora/72/5e0/9a2-011c-4421-9e38-ba34ac89ac08_playback.flv

In the above example, I am assuming that if the RTMP server is unavailable, it would fallback to the second url. Again if the second video format (mpg) is not supported, it will fallback to the third url, which is again RTMP. Since the RTMP server is unavailable, it will fallback to the final URL.

Will it work? From what I have observed, if the first url is not reachable, then it throws an error indicating the server is unavailable and does not try to fallback to the other sources.

3 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

You can do something like this:

<div id="myElement"></div> <script> jwplayer("myElement").setup({ playlist: [{ image: "/uploads/myPoster.jpg", sources: [{ file: "rtmp://" },{ file: "http://" }] }], primary: "flash" }); </script>

surendran.anup

User  
0 rated :

Yes, that is how I have it configured. But if the first URL is not accessible (because the backend rtmp server is down), then JW Player throws an error saying the server cannot be reached. But it does not try the second or the rest of the url's.

The only difference is I do not have the primary set to flash But I do not think that matters, will it?

Ethan Feldman

JW Player Support Agent  
0 rated :

Then you need to use onError(), and then load() a different file, using our API – http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference

This question has received the maximum number of answers.