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

Can't get JWPlayer to fallback to audio with image


I am using JWPlayer 6.8 and have quite a simple setup - basically it's a live video stream that falls back from HTML 5 HLS Streaming, to Flash RTMP and then if either of those are offline then it falls back to a live audio stream. I have 2 issues:
- I can't get a poster image to display on page load or when the audio stream loads either
- I cannot get this setup to work on Android at all, it attempts to play but buffers endlessly and nothing ever happens. I don't understand why an audio stream wouldn't load?

I have tried disabling the autostart but that doesn't change anything.
The test player is located here: http://trnsmt.tv/jw-player-test
Code below:

<script>
jwplayer('mediaspace').setup({
primary: 'html5',
image: 'http://trnsmt.tv/wp-content/themes/trnsmt/jwplayer-resources/vidplay2offline.jpg',
autostart: 'true',
stretching: 'exactfit',
width: '100%',
aspectratio: '16:9',
skin: 'http://trnsmt.tv/wp-content/themes/trnsmt/jwplayer-resources/skin/vapor.xml',
playlist: [{

sources: [
{ file: "rtmp://103.4.234.121/livepkgr/flv:livestream"},
{ file: "http://103.4.234.121/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8"},
{ file: "http://audio.trnsmt.tv:8007/trnsmt.mp3", image: "http://trnsmt.tv/wp-content/themes/trnsmt/jwplayer-resources/vidplay2offline.jpg"}
]}]
});
jwplayer('mediaspace').onError(function(){
jwplayer('mediaspace').load({file:"http://audio.trnsmt.tv:8007/trnsmt.mp3",image:"http://trnsmt.tv/wp-content/themes/trnsmt/jwplayer-resources/vidplay2offline.jpg"});
jwplayer('mediaspace').play();
})
</script>

7 Community Answers

sam

User  
0 rated :

Also - I'm facing issues with getting the order of the 3 streams correct. Even when my video is broadcasting via HLS & RTMP, it still seems to fallback to the audio before even trying to display the video...

Ethan Feldman

JW Player Support Agent  
0 rated :

Right now you have:

playlist: [{

sources: [

{ file: “rtmp://103.4.234.121/livepkgr/flv:livestream”},
{ file: “http://103.4.234.121/hls-live/livepkgr/definst/liveevent/livestream.m3u8”},
{ file: “http://audio.trnsmt.tv:8007/trnsmt.mp3”}
]}]

But if you want an image, you need:

playlist: [{
image: “http://trnsmt.tv/wp-content/themes/trnsmt/jwplayer-resources/vidplay2offline.jpg”,
sources: [
{ file: “rtmp://103.4.234.121/livepkgr/flv:livestream”},
{ file: “http://103.4.234.121/hls-live/livepkgr/definst/liveevent/livestream.m3u8”},
{ file: “http://audio.trnsmt.tv:8007/trnsmt.mp3”}
]}]

The order is correct, but you have forced primary to html5, which rtmp / hls won’t support (on desktops). Just remove that line.

Regarding Android, what OS, device, and browser are you using?

sam

User  
0 rated :

I've made the suggested changes and now I'm getting the problem of not falling back to the audio at all. What I'm seeing is a constant buffering symbol if the video streams are offline but it never falls back to the audio.

Is there another way to do this?
Code can be found in source of http://trnsmt.tv/jw-player-test/

sam

User  
0 rated :

*Correction - it is falling back to the audio stream even when the video is being broadcast.

Ethan Feldman

JW Player Support Agent  
0 rated :

Under:

aspectratio: ‘16:9’,

Add:

primary: “flash”,

sam

User  
0 rated :

Have made that change but now it continually shows the 'buffering' icon spinning but never falls back to the audio stream. Is there a way to limit this buffer time (to say 10 sec) and then have it throw an error so that I can use onError to load the audio stream?

Ethan Feldman

JW Player Support Agent  
0 rated :

That is what I do in the demo by setting a timer in JS.

This question has received the maximum number of answers.