1

I would like to use my JWPLAYER 6 pro to play the live stream and switch to vod download fallback if live stream is not available.

Here is my simple code:

<div id='playervideo' style="max-height:800px !important; max-width:1365 !important; min-height:392 !important; min-width:640 !important">
        <script type='text/javascript'>
            jwplayer('playervideo').setup({
                playlist: [{
                    image: "http://domain.com/directabouttostar.jpg",
                    sources: [{
                      file: "http://oxygenstream.fr/live2.f4m"
                    },{
                      file: "http://oxygenstream.fr/live2.m3u8"
                    },{
                      file: "http://oxygenstream.fr/vod.mp4"
                    }]
                  }],
                primary: "flash",
                androidhls: true,
                autostart:  true,
                fallback: true,
                width: '100%',
                aspectratio: "16:9",
                abouttext: '::::  OXYGENSTREAM.FR  ::::',
                aboutlink: 'http://oxygenstream.fr'
            });
        </script></div>
Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
Toinan
  • 25
  • 1
  • 8

1 Answers1

1

If the stream is down, the player will either error, or keep buffering.

What you can do is check for buffering, wait some time, then load a new file.

Or, you can check if the player errors, then load a new file.

Example:

http://support.jwplayer.com/customer/portal/articles/1442607-example-a-custom-error-message

emaxsaun
  • 4,191
  • 2
  • 13
  • 13
  • That's great but I could' not mahe it work as it is supposed to work. with the onbuffer, event if I send the stream, it starts to read my stream but switch back to load the file because of the buffering even during the live. – Toinan Apr 10 '15 at 00:49