This article describe how to detect the multicast stream availability with Enable JS .
The Java script below show an example on how to trigger calls depending on the player event callback
player.setEventCallback(function (e, h) { log("Received Videoevent: " + e.event); varsrc = player.getSource().source; if (e.event === "EN_VIDEOEVENT_PLAYBACK_BUFFER_READY") { buffer_ready(true); return; } if (e.event === "EN_VIDEOEVENT_PLAYBACK_BUFFERING") { buffer_ready(false); return; } if (e.event === "EN_VIDEOEVENT_PLAYBACK_STARTED") { log2("Video Started! " + src); decoder_ready(true); return; } if (e.event === "EN_VIDEOEVENT_PLAYBACK_STOPPED") { decoder_ready(false); log2("Video Stopped! " + src); return; } if (e.event === "EN_VIDEOEVENT_PLAYBACK_RESUMED") { decoder_ready(true); log2("Video Resumed! " + src); return; } }) |
For the list of player event . Please refer to the EnableJS document at the download area .
EN_VIDEOEVENT_PLAYBACK_BUFFER_READY , EN_VIDEOEVENT_PLAYBACK_BUFFERING
The player event to determine the stream availability .
EN_VIDEOEVENT_PLAYBACK_STARTED, EN_VIDEOEVENT_PLAYBACK_STOPPED,EN_VIDEOEVENT_PLAYBACK_RESUMED
The player event to determine the playback status .
The attached html file is a sample page for this article .
https://aminocom.zendesk.com/hc/article_attachments/14728948431129
When multicast stream is available and ready to play ,
Buffer : READY
Decoder state : PLAY
When multicast stream is unavailable .
Buffer : READY
Decoder state : STOP
A scrolling bar will be shown on top of the screen .