In the video example above, initial HLS playlist throws 404 (not existing) error. Offline image with retry interval countdown is diesplayed.
After 2 retry attempts (20 seconds interval), live video is back online.
After 2 retry attempts (20 seconds interval), live video is back online.
Live video offline plugin details
Latest offline plugin version (realesed Jan. 18, 2022) is completely new attempt to care about player display when live stream goes offline.Offline plugin is initialized on initial stream playlist errors (e.g. 404 error). It also starts when network is diconnected while playing, when internet connection goes down, when stream is broken completely. The plugin attempts to reconnect the stream automatically in user-defined intervals (default each 30 seconds).
The offline plugin features 3 easy to understand options.
- offlineImage - URL of the offline Image
- offlineTimeout (default 30) - timeout value (seconds) for offlineImage to retry live stream
- offlineCountdown (default true) - set false to disable visible countdown
Important: You need to set preload="none" video attribute to have the offline plugin working correctly.
Minimum setup is:Code snippet
<script src="//domain.com/videojs/videojs.min.js"></script> <script src="//domain.com/videojs/nuevo.min.js"></script> <script src="//domain.com/videojs/plugins/videojs.offline.js"></script> var player = videojs('myplayer'); player.nuevo(); player.offline({offlineImage: "//domain.com/path-to-video-image.jpg"}); </script>
Code snippet
player.offline({ offlineImage:"//domain.com/path-to-video-image.jpg", offlineTimeout:20, offlineCountdown:false, label:"Neustart" }); </script>