/*! @name videojs-playlist @version 4.2.6 @license Apache-2.0 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):e.videojsPlaylist=t(e.videojs)}(this,function(e){"use strict";var t=function(e){var t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.timeout=null,t.trigger=null},r=function e(r,n){var i;(t(r),"number"==typeof(i=n)&&!isNaN(i)&&i>=0&&i<1/0)?(r.playlist.autoadvance_.delay=n,r.playlist.autoadvance_.trigger=function(){var i=function(){return e(r,n)};r.one("play",i),r.playlist.autoadvance_.timeout=r.setTimeout(function(){t(r),r.off("play",i),r.playlist.next()},1e3*n)},r.one("ended",r.playlist.autoadvance_.trigger)):r.playlist.autoadvance_.delay=null},n=function(e,t){var n=!e.paused()||e.ended();return e.trigger("beforeplaylistitem",t),e.poster(t.poster||""),e.src(t.sources),function(e){for(var t=e.remoteTextTracks(),r=t&&t.length||0;r--;)e.removeRemoteTextTrack(t[r])}(e),e.ready(function(){if((t.textTracks||[]).forEach(e.addRemoteTextTrack.bind(e)),e.trigger("playlistitem",t),n){var i=e.play();void 0!==i&&"function"==typeof i.then&&i.then(null,function(e){})}r(e,e.playlist.autoadvance_.delay)}),e},i=function(e,t){for(var r=0;r=0&&e