0

If there is problem with playing video then JW player is showing error. When I am clicking on that error it is retrying to load video. But the message is not relevant to the user so I want to replace it.

"Cannot load M3U8: 404 not found" to "Click here to retry".

I google but did not find any solution however I find the code which run when error occurred but it is for when we want to show new image or load new video.

enter image description here

 jwplayer("live").setup({
        height: '100%',
        width: '100%',
      //  image:response.imageUrl,
        startparam: "fs",//starttime, start, ec_seek, apstart, fs
        androidhls: true,
        file: url,
        primary: "flash",
        deliveryType: "streaming",
        player: {
            modes: {
                linear: {
                    controls: {
                        stream: {
                            manage: false, enabled: false
                        }
                    }
                }
            }
        },
        shows: {
            streamTimer: {
                enabled: false, tickRate: 100
            }
        }
    }).onReady(function(){
        document.querySelector('#screenLoader').style.display= 'none';
        document.querySelector('#live-caption').style.display= 'block';
    })

  jwplayer().onError(function(event){
    console.log(event.message)
  })
Jitender
  • 7,593
  • 30
  • 104
  • 210

1 Answers1

0

Whilst stream detection (both start and stop) within JW Player seems to be a common requirement, the JW team are unfortunately yet to provide elegant hooks to manage these states - I think they may in time.

In the meantime, I've added a component to my Tatami for Online Video visual configuration tool which detects live streams and will present customisable messages based on the current state.

I've created a Tatami snapshot to demonstrate this for you: Tatami with Streamy

  • Click on the play icon in "Player setup" component to get a preview of the setup.
  • Check out the "Streamy options" component in order to change the messages.
  • Modify the source URLs in the "Media source" component to see how the setup reacts to working versus non-working streams.
  • Connect the "Streamy livestream" component to the "Media source" component to see how a 'countdown to live' can easily be implemented.
jherrieven
  • 425
  • 2
  • 5