le-player
Version:
The best HTML5 video player made for Lectoriy.
2 lines • 141 kB
JavaScript
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/dist/js/",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){var n=[].concat(e);return t.forEach(function(e){var t=n.indexOf(e);if(t>-1)return void n.splice(t,1)}),n}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(2),p=o(f),d=n(3),h=o(d),y=n(4),v=o(y),m=n(6),b=o(m),g=n(9),_=o(g),w=n(5),O=o(w),k=n(10),C=o(k),j=n(11),P=o(j),S=n(12),T=o(S),E=n(13),q=o(E),x=n(14),I=o(x),M=n(15),N=o(M),A=n(7),R=n(8),D=n(16),F=o(D),z=n(17),B=o(z);n(18),n(19),n(21),n(25),n(27),n(28),n(29),n(30),n(32),n(33),n(34),n(35),n(36),n(38),h.default.registerControl("divider",function(){return{element:(0,p.default)("<div/>").addClass("divider")}});var V={entity:"Html5",autoplay:!1,height:"auto",loop:!1,muted:!1,preload:"metadata",poster:null,svgPath:"",innactivityTimeout:5e3,rate:{step:.25,min:.5,max:4,default:1},playback:{step:{short:5,medium:10,long:30}},controls:{common:[["play","volume","divider","timeline","divider","section","divider","fullscreen"],["rate","divider","backward","divider","source","divider","subtitle","divider","download","divider","keybinding info"]],fullscreen:[["play","volume","divider","timeline","divider","rate","divider","keybinding info","divider","backward","divider","source","divider","subtitle","divider","download","divider","section","divider","fullscreen"]],mini:[["play","volume","divider","fullscreen","divider","timeinfo"]],"common:android":[["play","timeline","fullscreen"],["rate","source","section"]],"fullscreen:mobile":[["play","timeline","fullscreen"],["rate","source","section"]],"common:ios":[["play","rate","timeline","source"]]},controlsOptions:{common:{align:["justify","left"]},fullscreen:{align:"justify"},"common:android":{align:["justify","right"]},"fullscreen:mobile":{align:["justify","right"]}},volume:{default:.4,mutelimit:.05,step:.1},keyBinding:[{key:32,info:["Space"],description:"Начать проигрывание / поставить на паузу",fn:function(e){e.video.togglePlay()}},{key:37,info:["←"],description:"Перемотать на 10 секунд назад",fn:function(e){e.video.currentTime-=e.options.playback.step.medium,e.splashIcon.show("undo")}},{key:39,info:["→"],description:"Перемотать на 10 секунд вперёд",fn:function(e){e.video.currentTime+=e.options.playback.step.medium,e.splashIcon.show("redo")}},{shiftKey:!0,info:["Shift","←"],description:"Перейти на предыдущую секцию",key:37,fn:function(e){null!=e.sections&&e.sections.prev()}},{shiftKey:!0,key:39,info:["Shift","→"],description:"Перейти на следующую секцию",fn:function(e){null!=e.sections&&e.sections.next()}},{key:38,info:["↑"],description:"Увеличить громкость",fn:function(e){e.video.volume+=e.options.volume.step,e.splashIcon.show(e.calcVolumeIcon(e.video.volume))}},{key:40,info:["↓"],description:"Уменьшить громкость",fn:function(e){e.video.volume-=e.options.volume.step,e.splashIcon.show(e.calcVolumeIcon(e.video.volume))}},{key:70,info:["f"],description:"Открыть/закрыть полноэкраный режим",fn:function(e){e.toggleFullscreen()}}],plugins:{miniplayer:{}},onPlayerInited:A.noop},L=function(e){function t(e,n){i(this,t),n.createElement=!1;var o=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,null,n));return o._element=e,o.innerElement=(0,A.createEl)("div"),o._userOptions=n,o._initOptions(),""===o.options.svgPath&&t._loadSVGSprite(t.defaultSprite),o._view="common",o.element=o.createElement(),o.loadEntity(o.options.entity,{ctx:e}),o.video=o.entity,o.controls={},o._initControls(),o._dblclickTimeout=null,o._initSections().then(function(e){o.trigger("sectionsinit",e)}),o._initPlugins(),o._listenHotKeys(),o._userActivity=!1,o._listenUserActivity(),o._waitingTimeouts=[],["durationchange","progress","dblclick","click","canplay","qualitychange","trackschange"].forEach(function(e){o.video.on(e,function(){o.trigger(e)})}),o.video.one("play",function(){o.trigger("firstplay"),o.removeClass("leplayer--virgin")}),o.video.on("timeupdate",function(){o.video.currentTime>0&&o.removeClass("leplayer--virgin"),o.trigger("timeupdate",{time:o.video.currentTime,duration:o.video.duration})}),o.video.on("loadstart",function(){o.removeClass("leplayer--ended"),o.error=null,o.trigger("loadstart")}),o.video.on("seeking",function(){o._startWaiting(),o.trigger("seeking")}),o.video.on("seeked",function(){o._stopWayting(),o.trigger("seeked")}),o.video.on("volumechange",function(){o.trigger("volumechange",{volume:o.video.volume})}),o.video.on("posterchange",function(e,t){var n=t.url;o.poster.url=n,o.trigger("posterchange")}),o.video.on("play",function(e){o.removeClass("leplayer--ended"),o.removeClass("leplayer--paused"),o.addClass("leplayer--playing"),o.trigger("play")}),o.video.on("pause",function(){o.removeClass("leplayer--playing"),o.addClass("leplayer--paused"),o.trigger("pause")}),o.video.on("playing",function(){o._stopWayting(),o.trigger("playing")}),o.video.on("ratechange",function(){o.trigger("ratechange",{rate:o.video.rate})}),o.video.on("ended",function(){o.addClass("leplayer--ended"),o.options.loop?(o.currentTime=0,o.video.play()):o.video.paused||o.video.pause(),o.trigger("ended")}),o.video.on("canplaythrough",function(){o._stopWayting(),o.trigger("canplaythrough")}),o.video.on("waiting",function(){o._startWaiting(),o.video.one("timeupdate",function(){return o._stopWayting()}),o.trigger("waiting")}),o.video.on("error",function(e,t){o.error=new B.default(t.code)}),o.video.init().then(function(){o.trigger("inited"),o.options.time&&(o.currentTime=o.options.time),null!=o.video.src&&o.options.autoplay&&o.play()}),o.on("fullscreenchange",o._onFullscreenChange.bind(o)),o.on("click",o._onClick.bind(o)),o.on("dblclick",o._onDbclick.bind(o)),o.on("inited",o._onInited.bind(o)),o.on("play",o._onPlay.bind(o)),o.on("pause",o._onPause.bind(o)),(0,p.default)(document).on(N.default.fullscreenchange,o._onEntityFullscrenChange.bind(o)),o}return a(t,e),c(t,[{key:"loadEntity",value:function(e,n){var o=t.getComponent(e);this._entity=new o(this,n)}},{key:"play",value:function(){return this.video.play()}},{key:"pause",value:function(){return this.video.pause()}},{key:"togglePlay",value:function(){return this.video.togglePlay()}},{key:"load",value:function(){return this.video.load()}},{key:"onSetView",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return this.on.apply(this,["setview."+e].concat(n)),this}},{key:"changeQuality",value:function(e){var t=this.video;if(null!=e){var n=this.currentTime,o=this.rate,r=this.paused;t.src=e,this.playbackRate=o,this.currentTime=n,r?this.pause():this.play()}}},{key:"onDelView",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return this.on.apply(this,["delview."+e].concat(n)),this}},{key:"getData",value:function(){var e=new p.default.Deferred;return void 0!==this._data?(e.resolve(this._data),e.promise()):"string"==typeof this.options.data?p.default.ajax({url:this.options.data,method:"GET",dataType:"json"}).promise():"object"===s(this.options.data)?(e.resolve(this.options.data),e.promise()):void 0}},{key:"getSectionData",value:function(){return this.getData().then(function(e){return e.sections})}},{key:"requestFullscreen",value:function(){var e=N.default;e.requestFullscreen?(this.element[0][e.requestFullscreen](),this.trigger("fullscreenchange",!0)):this.video.supportsFullScreen()&&this.video.enterFullscreen()}},{key:"exitFullscreen",value:function(){var e=N.default;e.exitFullscreen?document[e.exitFullscreen]():this.video.supportsFullScreen()&&this.video.exitFullscreen(),this.trigger("fullscreenchange",!1)}},{key:"toggleFullscreen",value:function(){"fullscreen"===this.view?this.exitFullscreen():this.requestFullscreen()}},{key:"getControls",value:function(e){return this.controls[e]}},{key:"getWidth",value:function(){return this.element.width()}},{key:"_completeSections",value:function(e){if(null!=e&&0!==e.length){for(var t=[].concat(e),n=0;n<t.length;n++){var o=void 0;o=n<t.length-1?t[n+1].begin:this.video.duration,t[n].end=o}return t}}},{key:"createElement",value:function(){var e=this.options,t=this._element;this.element=(0,A.createEl)("div"),this.element=this.element.addClass("leplayer").attr("tabindex",0).css("width",e.width&&"100%").css("max-width",e.width),this.errorDisplay=new q.default(this),this.playButton=new b.default(this),this.loader=(0,p.default)("<div />").addClass("leplayer-loader-container").append(new O.default(this,{iconName:"refresh",className:"leplayer-loader-container__icon"}).element),this.splashIcon=new _.default(this),this.videoContainer=(0,A.createEl)("div",{className:"leplayer-video"}).append(this.errorDisplay.element).append(this.playButton.element).append(this.loader).append(this.splashIcon.element),this.poster=new I.default(this),this.videoContainer.append(this.poster.element);var n=new C.default(this,{fn:function(e){var t=e.video;return(0,A.secondsToTime)(t.duration-t.currentTime)}});return this.options.videoInfo&&console.warn("options.videoInfo is deprecated, please use istead options.description"),this.infoElement=(0,A.createEl)("div",{className:"leplayer__info"}).append((0,A.createEl)("div",{className:"leplayer__title",html:this.options.title||""})).append((0,A.createEl)("div",{className:"leplayer__video-info",html:this.options.description||this.options.videoInfo||""})).append((0,A.createEl)("div",{className:"leplayer__last",html:"Видео закончится через "}).append(n.element)),this.innerElement=(0,p.default)("<div />").addClass("leplayer__inner").append(this.videoContainer).append(this.infoElement),this.element=this.element.append(this.innerElement),this.addClass("leplayer--paused"),this.addClass("leplayer--virgin"),R.IS_IPHONE&&this.addClass("leplayer--iphone"),R.IS_ANDROID&&this.addClass("leplayer--android"),R.IS_MOBILE&&this.addClass("leplayer--mobile"),e.sectionContainer&&(this.sectionsContainer=(0,p.default)(e.sectionContainer)),t.before(this.element),this.videoContainer.append(t),this.element}},{key:"_optionsFromElement",value:function(){var e=this._element;if(null==e||0===e.length)return{};var t=["height","width","poster","autoplay","loop","muted","preload"].reduce(function(t,n){var o=e.attr(n);return null!=o&&(t[n]=e.attr(n)),t},{});return t.sources=[],e.attr("src")&&(t.src={url:e.attr("src"),title:e.attr("data-quality")||e.attr("title")||"default"}),e.find("source").each(function(e,n){n=(0,p.default)(n),n.attr("data-quality")&&(t.sources=t.sources.concat({url:n.attr("src"),title:n.attr("data-quality")||n.attr("title")||"default"}))}),t}},{key:"calcVolumeIcon",value:function(e){null==e&&(e=this.video.volume);var t=e;return t<this.options.volume.mutelimit?"volume-off":e<.5?"volume-down":"volume-up"}},{key:"toggleSections",value:function(e){this.sections&&(this.sections.visible=e),this.outsideSections&&(this.outsideSections.visible=e)}},{key:"_initOptions",value:function(){var e=this,n=this._optionsFromElement(),o={};this._userOptions.preset&&t.getPreset(this._userOptions.preset)&&(o=t.getPreset(this._userOptions.preset).options),this.options=p.default.extend(!0,{},V,o,n,this._userOptions),this.options.sources&&!Array.isArray(this.options.sources)&&(this.options.sources=[this.options.sources]),"string"==typeof this.options.src&&(this.options.src={url:this.options.src}),null==this.options.src&&this.options.sources.length>0&&(this.options.src=this.options.sources[0]),this.options.controls=p.default.extend({},V.controls,o.controls,this._userOptions.controls);var r=function(t){if(!e.options.excludeControls.hasOwnProperty(t))return{v:void 0};var n=e.options.excludeControls[t];n.forEach(function(n,o){e.options.controls[t]&&e.options.controls[t][o]&&(e.options.controls[t][o]=u(e.options.controls[t][o],n))})};for(var i in this.options.excludeControls){var l=r(i);if("object"===("undefined"==typeof l?"undefined":s(l)))return l.v}this.options.preset&&t.getPreset(this.options.preset)&&t.getPreset(this.options.preset).initOptions()}},{key:"_initControls",value:function(){for(var e=["common","fullscreen"],t=0;t<e.length;t++){var n=e[t];if(!this.options.controls.hasOwnProperty(n))return;var o=new P.default(this,{name:n});this.element.append(o.element)}null!=this.controls.common&&(this.controls.common.active=!0)}},{key:"_listenHotKeys",value:function(){var e=this,t=function(e,t){return(e.which===t.key||e.key===t.key)&&!!t.shiftKey===e.shiftKey&&!!t.ctrlKey===e.ctrlKey};this.element.on("keydown.leplayer.hotkey",function(n){e.options.keyBinding.forEach(function(o){if(t(n,o))return n.preventDefault(),o.fn(e),!1})})}},{key:"_initSections",value:function(){var e=this,t=p.default.Deferred();return null==this.options.data?t.reject(null):this.getSectionData().done(function(n){n=[].concat(r(n));var o=e.sectionsContainer&&e.sectionsContainer.length>0;return null==n||0===n.length?void t.reject(null):(n=e._completeSections(n),e.sections=new T.default(e,{items:n,fullscreenOnly:o,hideScroll:!0}),e.innerElement.append(e.sections.element),o&&(e.outsideSections=new T.default(e,{items:n}),e.sectionsContainer.append(e.outsideSections.element)),void t.resolve({items:n}))}),t.promise()}},{key:"_initPlugins",value:function(){if(this.options.plugins)for(var e in this.options.plugins){if(!this.options.plugins.hasOwnProperty(e))return;var t=this.options.plugins[e];this[e]?t&&this[e](t):console.error("Plugin '"+e+"' doesn't exist")}return this}},{key:"_listenUserActivity",value:function(){var e=this,t=void 0,n=void 0,o=void 0,r=function(t){t.screenX===n&&t.screenY===o||(n=t.screenX,o=t.screenY,e._userActivity=!0)},i=function(n){e._userActivity=!0,clearInterval(t),t=setInterval(function(){e._userActivity=!0},250)},l=function(n){e._userActivity=!0,clearInterval(t)};this.element.on("mousemove",r),this.element.on("mousedown",i),this.element.on("mouseup",l),this.element.on("keydown",function(t){return e._userActivity=!0}),this.element.on("keyup",function(t){return e._userActivity=!0});var a=void 0,u=this.options.innactivityTimeout;setInterval(function(){e._userActivity&&(e._userActivity=!1,e.userActive=!0,clearTimeout(a),u>0&&(a=setTimeout(function(){e._userActivity||(e.userActive=!1)},u)))},250)}},{key:"_stopWayting",value:function(){this._waitingTimeouts.forEach(function(e){return clearTimeout(e)}),this._waitingTimeouts=[],this.removeClass("leplayer--waiting")}},{key:"_startWaiting",value:function(){var e=this;this._waitingTimeouts.push(setTimeout(function(){e.addClass("leplayer--waiting")},300))}},{key:"_onInited",value:function(e){this.addClass("leplayer--inited"),this.options.onPlayerInited.call(this,e)}},{key:"_onClick",value:function(e){var t=this;clearTimeout(this._dblclickTimeout);var n=function(){t._dblclickTimeout=setTimeout(function(){t.video.element.focus(),t.togglePlay()},300)};(0,R.IS_TOUCH)()&&"fullscreen"===this.view?this.player.userActive&&n():n()}},{key:"_onDbclick",value:function(e){clearTimeout(this._dblclickTimeout),this.toggleFullscreen()}},{key:"_onFullscreenChange",value:function(e,t){t?(this.view="fullscreen",R.IS_ANDROID&&(this._lastSectionsValue=this.sections.visible,this.sections.visible=!1),this.focus()):(this.view="common",R.IS_ANDROID&&(this.sections.visible=this._lastSectionsValue),(R.IS_ANDROID_PHONE||R.IS_IPHONE||R.IS_IPOD)&&this.pause())}},{key:"_onPlay",value:function(){this.splashIcon.show("play")}},{key:"_onPause",value:function(){this.splashIcon.show("pause")}},{key:"_onEntityFullscrenChange",value:function(){var e=N.default,t=!!document[e.fullscreenElement];this.trigger("fullscreenchange",t)}},{key:"entity",get:function(){return this._entity}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){this.video.currentTime=e}},{key:"duration",get:function(){return this.video.duration}},{key:"ended",get:function(){return this.video.ended}},{key:"error",get:function(){return this._error||null},set:function(e){return null===e?(this._error=null,this.removeClass("leplayer--error"),this.errorDisplay&&this.errorDisplay.element.hide(),this):(this._error=new B.default(e),this.addClass("leplayer--error"),this.trigger("error",{error:this._error}),this)}},{key:"rate",get:function(){return this.video.rate},set:function(e){this.video.rate=e}},{key:"paused",get:function(){return this.video.paused}},{key:"height",get:function(){return this.element.height()}},{key:"videoHeight",get:function(){return this.video.height}},{key:"userActive",get:function(){return this._userActive||!1},set:function(e){e!==this.getUserActive&&(this._userActive=e,this.toggleClass("leplayer--user-active",e),this.trigger("useractive"))}},{key:"view",get:function(){return this._view},set:function(e){return null!=this.view&&(this.removeClass("leplayer--"+this.view),this.trigger("delview."+this.view)),this._view=e,this.element.addClass("leplayer--"+e),this.trigger("setview."+e),this}}]),t}(v.default);L.plugin=function(e,t){L.prototype[e]=t},L.getComponent=v.default.getComponent,L.registerComponent=v.default.registerComponent,L.getControl=h.default.getControl,L.registerControl=h.default.registerControl,L.secondsToTime=A.secondsToTime,L.preset=function(e,t){"object"===("undefined"==typeof t?"undefined":s(t))?L._presets[e]=p.default.extend({},{options:{},initOptions:A.noop},t):"function"==typeof t&&(L._presets[e]=t())},L.getPreset=function(e){return L._presets[e]?L._presets[e]:(console.error("preset "+e+" doesn't exist"),null)},L._presets={},L.Cookie=F.default,L._loadSVGSprite=function(e){var t=(0,p.default)("<div/>").hide();return(0,p.default)("body").prepend(t.append(e)),t},L.defaultSprite=n(64),L.version="0.5.4",window.$.fn.lePlayer=function(e){return this.each(function(){return new L((0,p.default)(this),e)})},window.$.lePlayer=L,window.lePlayer=L,L.plugin("miniplayer",function(e){var t=this,n=this,o=p.default.extend({},{width:"100%",offsetShow:function(e){var t=e.element.offset().top+e.element.outerHeight()-e.getControls("common").element.height();return t}},this.options.miniplayer,e),r=new P.default(this,{name:"mini",controls:o.controls,controlOptions:{control:{disable:!1}}});this.infoElement.append(r.element);var i=function(){return p.default.isFunction(o.offsetShow)?o.offsetShow(n):o.offsetShow},l=function(){return o.width||t.element.width()};this._updateMiniPlayer=function(e,n){var o=(0,p.default)(window).scrollTop();n&&t.hideMiniPlayer(n),o>i()?t.showMiniPlayer(n):t.hideMiniPlayer()},this.showMiniPlayer=function(e){(e||"mini"!==t.view)&&(t.element.css("padding-top",t.videoContainer.height()),t.view="mini")},this.hideMiniPlayer=function(e){(e||"mini"===t.view)&&(t.view="common")},(0,p.default)(window).on("scroll",this._updateMiniPlayer.bind(this)),(0,p.default)(window).on("resize",this._updateMiniPlayer.bind(this)),this.on("inited",function(e){return t._updateMiniPlayer(e,!0)}),this.onSetView("mini",function(){t.innerElement.css("max-width",l()),t.innerElement.css("height",t.video.height)}),this.onDelView("mini",function(){t.innerElement.css("max-width",""),t.innerElement.css("height",""),t.element.css("padding-top","")}),this._updateMiniPlayer()}),L.preset("vps",n(65).preset),L.preset("simple",n(66).preset),L.preset("sms",n(67).preset),L.preset("compressed",n(68).preset),L.preset("2035",n(69).preset),e.exports=L},function(e,t){e.exports=$},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var l=r.get;if(void 0!==l)return l.call(o)},s=n(2),c=o(s),f=n(4),p=o(f),d=n(5),h=o(d),y=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.emitTapEvents(),o.disable=null==o.options.disable||o.options.disable,o.player.on("inited",function(e){o.disable=null!=o.options.disable&&o.options.disable}),o.element.on({click:o.onClick.bind(o),tap:o.onClick.bind(o)}),o.player.on("inited",o.onPlayerInited.bind(o)),o}return l(t,e),a(t,[{key:"createElement",value:function(){this.options.iconName&&(this.icon=new h.default(this.player,{iconName:this.options.iconName}));var e={title:this.options.title};return this.element=(0,c.default)("<"+(this.options.tag||"button")+" />").addClass(this.buildCSSClass()).append(this.icon&&this.icon.element).attr(e),this.element}},{key:"buildCSSClass",value:function(){var e="control "+this.options.className+" "+u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildCSSClass",this).call(this);return this.player.hasClass("leplayer--iphone")||(e+=" control--no-iphone"),e}},{key:"onClick",value:function(e){return e.preventDefault(),!this.disable&&(this.player.trigger("controlclick",{control:this}),void("function"==typeof this.options.onClick&&this.options.onClick.call(this,arguments)))}},{key:"onPlayerInited",value:function(e,t){}},{key:"tap",set:function(e){this.toggleClass("control--tap",e)}},{key:"disable",set:function(e){this._disable=e,this.toggleClass("disabled",e)},get:function(){return this._disable}}],[{key:"registerControl",value:function(e,n){if(null!=e)return null==t._controls&&(t._controls={}),t._controls[e]=n,n}},{key:"getControl",value:function(e){if(null!=e)return t._controls&&t._controls[e]?t._controls[e]:void 0}},{key:"create",value:function(e,t,n){var o=this.getControl(t);return null==o?(console.error("Control "+t+" doesn't exist"),null):new o(e,n)}}]),t}(p.default);p.default.registerComponent("Control",y),y.registerControl("control",y),t.default=y},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),a=o(l),u=function(e){return e.split(" ").reduce(function(e,t){return e+("leplayer_"+t+" ")},"")},s=function(){function e(t,n){r(this,e),n=this.options=a.default.extend({},{createElement:!0},this.options,n),t||null==this.play?this.player=t:this.player=t=this,n.createElement&&(n.element?this.element=n.element:this.createElement(),1!==this.element.length&&console.error("Component.prototype.element.length must equal 1, not "+this.element.length+"\n",this.element),this.element[0].__node=this)}return i(e,[{key:"createElement",value:function(){return""}},{key:"buildCSSClass",value:function(){return""}},{key:"focus",value:function(){this.element.focus()}},{key:"blur",value:function(){this.element.blur()}},{key:"trigger",value:function(e){for(var t,n=a.default.Event("leplayer_"+e,{player:this.player}),o=arguments.length,r=Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return(t=this.element).triggerHandler.apply(t,[n].concat(r)),this}},{key:"on",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if("string"==typeof e||e instanceof String){var r;(r=this.element).on.apply(r,[u(e)].concat(n))}else{var i;console.warn("First argument of 'Component.on' should be a string"),(i=this.element).on.apply(i,[e].concat(n))}return this}},{key:"one",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if("string"==typeof e||e instanceof String){var r;(r=this.element).one.apply(r,[u(e)].concat(n))}else{var i;console.warn("First argument of 'Component.one' should be a string"),(i=this.element).one.apply(i,[e].concat(n))}return this}},{key:"addClass",value:function(e){return this.element.addClass(e),this}},{key:"removeClass",value:function(e){return this.element.removeClass(e),this}},{key:"toggleClass",value:function(e,t){return this.element.toggleClass(e,t),this}},{key:"hasClass",value:function(e){return this.element.hasClass(e)}},{key:"emitTapEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null==t&&(t=this.element);var n=0,o=null,r=null,i=10,l=200,u=void 0;t.on("touchstart",function(t){1===t.touches.length&&(o=r={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},n=(new Date).getTime(),u=!0,e.tap=!0)}),t.on("touchmove",function(t){if(t.touches.length>1)u=!1;else if(o){var n=t.touches[0].pageX-o.pageX,l=t.touches[0].pageY-o.pageY,a=Math.sqrt(n*n+l*l);1===t.touches.length&&(r={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY}),a>i&&(u=!1,e.tap=!1)}});var s=function(){u=!1,e.tap=!1};t.on("touchleave",s),t.on("touchcancel",s),t.on("touchend",function(i){if(o=null,e.tap=!1,u===!0){var s=(new Date).getTime()-n;if(s<l){i.preventDefault();var c=a.default.Event("tap");c.pageX=r.pageX,c.pageY=r.pageY,t.trigger(c)}}})}},{key:"tap",set:function(e){}}],[{key:"registerComponent",value:function(t,n){if(null!=t)return null==e._components&&(e._components={}),e._components[t]=n,n}},{key:"getComponent",value:function(t){if(null!=t)return e._components&&e._components[t]?e._components[t]:void 0}}]),e}();s.registerComponent("Component",s),t.default=s},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var l=r.get;if(void 0!==l)return l.call(o)},s=n(2),c=o(s),f=n(4),p=o(f),d=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(this,t),n=c.default.extend({},{className:"",iconName:""},n),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return l(t,e),a(t,[{key:"createElement",value:function(){return this._useTag=document.createElementNS("http://www.w3.org/2000/svg","use"),this._svgTag=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.iconName=this._iconName=this.options.iconName,this._svgTag.appendChild(this._useTag),this.element=(0,c.default)("<div />").addClass(this.buildCSSClass()).attr("title",this.options.title).append((0,c.default)(this._svgTag)),this.element}},{key:"buildCSSClass",value:function(){return u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildCSSClass",this).call(this)+" leplayer-icon "+this.options.className}},{key:"iconName",set:function(e){var t,n,o=["http://www.w3.org/1999/xlink","href"];(t=this._useTag).removeAttributeNS.apply(t,o.concat([this.player.options.svgPath+"#leplayer-icon-"+this.iconName])),(n=this._useTag).setAttributeNS.apply(n,o.concat([this.player.options.svgPath+"#leplayer-icon-"+e])),this._iconName=e},get:function(){return this._iconName}}]),t}(p.default);p.default.registerComponent("Icon",d),t.default=d},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var l=r.get;if(void 0!==l)return l.call(o)},s=n(3),c=o(s),f=n(4),p=o(f),d=n(5),h=o(d),y=n(7),v=n(8),m=function(e){function t(e,n){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return l(t,e),a(t,[{key:"createElement",value:function(){var e=(0,y.createEl)("div",{className:"leplayer-play-button__button"}).append(new h.default(this.player,{iconName:"play"}).element);return this.element=(0,y.createEl)("div",{className:this.buildCSSClass()}).append(e),this.element}},{key:"onClick",value:function(e){u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClick",this).call(this,e),(0,v.IS_TOUCH)()&&"fullscreen"===this.player.view?this.player.userActive&&this.player.play():this.player.play()}},{key:"buildCSSClass",value:function(){return"leplayer-play-button "+this.options.className}}]),t}(c.default);p.default.registerComponent("PlayButton",m),c.default.registerControl("play button",m),t.default=m},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=Math.floor(e%3600%60),i="";return o<10&&(o="0"+o),r<10&&(r="0"+r),i=o+":"+r,(n>0||t)&&(i=n+":"+i),i}function i(e,t){
var n=e/t||0;return n>=1?1:n}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments[1];return t&&t.className&&(t.class=t.className,delete t.className),(0,c.default)("<"+e+"/>",t)}function a(e){}function u(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getScrollBarWidth=void 0,t.secondsToTime=r,t.percentify=i,t.createEl=l,t.$html=a,t.noop=u;var s=n(2),c=o(s);t.getScrollBarWidth=function(){var e=void 0;return function(){if(null!=e)return e;var t=(0,c.default)("<div />").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),n=(0,c.default)("<div />").css({width:"100%"}).appendTo(t).outerWidth();return t.remove(),e=100-n}}()},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=window.navigator&&window.navigator.userAgent||"",o=t.IS_MOBILE=/Mobile/i.test(n),r=t.IS_CHROME=n.indexOf("Chrome")>-1,i=t.IS_ANDROID=/Android/i.test(n),l=(t.IS_ANDROID_PHONE=i&&o,t.IS_IPAD=/iPad/i.test(n)),a=t.IS_IPHONE=/iPhone/i.test(n)&&!l,u=t.IS_IPOD=/iPod/i.test(n);t.IS_IOS=a||l||u,t.IS_SAFARI=n.indexOf("Safari")>-1&&!r,t.IS_TOUCH=function(){return"ontouchstart"in window||navigator.maxTouchPoints}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(2),s=o(u),c=n(4),f=o(c),p=n(5),d=o(p),h=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),a(t,[{key:"show",value:function(e){var t=this;this.icon.iconName=e,this.element.addClass("leplayer-splashicon--active"),setTimeout(function(){return t.element.removeClass("leplayer-splashicon--active")},300)}},{key:"createElement",value:function(){return this.icon=new d.default(this.player),this.element=(0,s.default)("<div />").addClass("leplayer-splashicon").append(this.icon.element)}}]),t}(f.default);t.default=h},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(2),s=o(u),c=n(4),f=o(c),p=n(7),d=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),n=s.default.extend({},{fn:function(e){var t=e.video;return(0,p.secondsToTime)(t.currentTime)}},n);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.player.on("timeupdate",o.updateText.bind(o)),o.player.on("inited",o.updateText.bind(o)),o}return l(t,e),a(t,[{key:"updateText",value:function(e,t){this.element.text(this.options.fn(this.player))}},{key:"createElement",value:function(){return this.element=(0,p.createEl)("div",{className:"leplayer-time"}),this.element}}]),t}(f.default);f.default.registerComponent("Time",d),t.default=d},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(2),c=o(s),f=n(4),p=o(f),d=n(3),h=o(d),y=n(7),v=n(8),m=function(e){function t(e,n){r(this,t);var o=n,l=o.name,a={},u={},s=[];null!=l&&(s=e.options.controls[l],u=e.options.controlsOptions[l],[{flag:v.IS_MOBILE,name:"mobile"},{flag:v.IS_ANDROID_PHONE,name:"android"},{flag:v.IS_IPHONE,name:"ios"}].forEach(function(t){if(t.flag){var n=l+":"+t.name;e.options.controls[n]&&(a=c.default.extend({},a,e.options.controlsOptions[n]),s=e.options.controls[n])}return t.flag})),n=c.default.extend({},{controls:s,align:"left",controlsOptions:{}},a,u,n);var f=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return f.active=n.active||!1,f.name=n.name,f.player.controls[f.name]=f,f}return l(t,e),u(t,[{key:"_getControlOptions",value:function(e){var t=this.options.controlsOptions,n=t.control||{};return t[e]&&(n=c.default.extend(!0,{},n,t[e])),n}},{key:"addControl",value:function(e,t,n){var o=h.default.create(this.player,t,a({collection:this.options.name},n));if(null!=o){for(;e>this._rows.length;)this.addRow();var r=this._rows[e];r.append(o.element),null==this.controls&&(this.controls=[]),null==this.controls[e]&&(this.controls[e]={}),this.controls[e][t]=o}}},{key:"getControl",value:function(e,t){if(null!=t){var n=e,o=t;return this.controls[o][n]}for(var r=e,i=0;i<this.controls.length;i++)if(null!=this.controls[i][r])return this.controls[i][r];return null}},{key:"addRow",value:function(){var e=(0,y.createEl)("div",{className:"leplayer-controls controls-"+this.options.name});return null==this._rows&&(this._rows=[]),this._rows.push(e),this.element.append(e),e}},{key:"getRow",value:function(e){return this._rows[e||0]}},{key:"createElement",value:function(){var e=this,t=this.options,n=t.name,o=t.controls,r=t.align,i=null;return this.element=(0,y.createEl)("div",{className:"leplayer-control-collection leplayer-control-collection--"+n}),"string"==typeof r&&(i=r),o.forEach(function(t,o){var l=e.addRow(),a=i;Array.isArray(r)&&r[o]&&(a=r[o]),t.forEach(function(t){"timeline"===t&&"justify"!==a&&console.warn("Conrols should have justify align, if there is the timeline in it"),e.addControl(o,t,e._getControlOptions(n))}),l.addClass("leplayer-controls--"+a).attr("tabindex",0),l.find(".divider + .divider").remove()}),this.element}},{key:"hide",value:function(){this.element.hide(),this.element.find(".leplayer-controls").hide()}},{key:"show",value:function(){this.element.show(),this.element.find(".leplayer-controls").show()}}]),t}(p.default);p.default.registerComponent("ControlCollection",m),t.default=m},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(2),s=o(u),c=n(4),f=o(c),p=n(7),d=function(e){function t(e,n){var o;r(this,t);var l=n.items,a=void 0===l?[]:l;a=[].concat(a);var u=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return u.scrollElement=u._innerElement,u.activeSection=u.getSectionByIndex(0),u.items=a,u.length=u.items.length,u.setActiveByIndex(0),u.element.find(".leplayer-section").on("click",u.onSectionClick.bind(u)),u.player.on("timeupdate",u.onTimeUpdate.bind(u)),u.player.on("inited",u.updateSectionDuration.bind(u)),u.player.on("durationchange",u.updateSectionDuration.bind(u)),u.player.on("focus",function(){return u.player.focus()}),o=u,i(u,o)}return l(t,e),a(t,[{key:"next",value:function(){var e=parseInt(this.activeSection.attr("data-index")),t=e>=this.length?this.length:e+1;this.setActiveByIndex(t),this.player.video.currentTime=this.items[e].end}},{key:"prev",value:function(){var e=parseInt(this.activeSection.attr("data-index")),t=e<=0?0:e-1;this.setActiveByIndex(t),this.player.video.currentTime=this.items[t].begin}},{key:"createElement",value:function(){var e=this.options,t=e.fullscreenOnly,n=e.hideScroll;return this.element=(0,s.default)("<div />").addClass("leplayer-sections").attr("tabindex","0"),this._innerElement=(0,s.default)("<div />").addClass("leplayer-sections__inner"),t&&this.element.addClass("leplayer-sections--fsonly"),n&&(this.element.addClass("leplayer-sections--hide-scroll"),this._innerElement.css({right:-1*(0,p.getScrollBarWidth)()})),this.element.append(this._innerElement.append(this._createSections(this.options.items))),this.element}},{key:"updateSectionDuration",value:function(){if(null!=this.items&&this.items.length>0){var e=this.items.length;this.items[e-1].end=this.player.video.duration}}},{key:"onSectionClick",value:function(e){var t=this.player.video,n=(0,s.default)(e.target).closest(".leplayer-section");t.currentTime=n.attr("data-begin"),this.player.trigger("sectionsclick",{section:this.items[n.attr("data-index")]})}},{key:"setActiveByIndex",value:function(e){if(0===this.activeSection.length||parseInt(this.activeSection.attr("data-index"))===e||0===this.getSectionByIndex(e).length)return this;this.activeSection.removeClass("leplayer-section--active"),this.activeSection=this.getSectionByIndex(e),this.activeSection.addClass("leplayer-section--active");var t=this.activeSection.position().top;return this.scrollElement.animate({scrollTop:this.scrollElement.scrollTop()+t},800),this.player.trigger("sectionschange",{section:this.items[e]}),this}},{key:"getSectionByIndex",value:function(e){return this.element.find('.leplayer-section[data-index="'+e+'"]')}},{key:"onTimeUpdate",value:function(e,t){if(0!==this.activeSection.length){var n=this.player.currentTime;if("mini"===this.player.view){var o=this.activeSection.attr("data-end");this.activeSection.next().find(".time").text((0,p.secondsToTime)(o-n))}for(var r=0;r<this.items.length;r++){var i=this.items[r];if(n<i.end){this.setActiveByIndex(r);break}}}}},{key:"createSection",value:function(e,t){var n=this.items||this.options.items,o=('\n\t\t\t<div class="leplayer-section '+(t?"":"leplayer-section--active")+'"\n\t\t\t\tdata-begin="'+e.begin+'"\n\t\t\t\tdata-index="'+t.toString()+'"\n\t\t\t\tdata-end="'+e.end+'">\n\t\t\t\t<div class="leplayer-section-time">'+(0,p.secondsToTime)(e.begin)+'</div>\n\t\t\t\t<div class="leplayer-section-info">\n\t\t\t\t\t<div class="leplayer-section-next-info">\n\t\t\t\t\t\t'+(e.nextInfo||"Следующая секция начнется через")+'\n\t\t\t\t\t\t<span class="time">'+(0,p.secondsToTime)(n[0].end)+"</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t"+(null!=e.title?'<div class="leplayer-section-title">'+e.title+"</div>":"")+"\n\t\t\t\t\t"+(null!=e.description?'<div class="leplayer-section-description">'+e.description+"</div>":"")+"\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t").trim();return o}},{key:"updateSection",value:function(e,t){this.getSectionByIndex(t).replaceWith(this.createSection(e,t)).on("click",this.onSectionClick.bind(this))}},{key:"_createSections",value:function(e){var t=this,n="";return e.forEach(function(e,o){n+=t.createSection(e,o)}),n}},{key:"visible",set:function(e){this.element.hasClass("leplayer-sections--hidden")&&e?(this.element.removeClass("leplayer-sections--hidden"),this.player.trigger("sectionstoggle",{isVisible:e})):e||(this.element.addClass("leplayer-sections--hidden"),this.player.trigger("sectionstoggle",{isVisible:e}))},get:function(){return!this.element.hasClass("leplayer-sections--hidden")}}]),t}(f.default);f.default.registerComponent("Sections",d),t.default=d},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(2),s=o(u),c=n(4),f=o(c),p=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return null!=o.player._error&&(o.message=o.player._error.message,o.element.show()),o.player.on("error",o.onPlayerError.bind(o)),o}return l(t,e),a(t,[{key:"createElement",value:function(){this.element=(0,s.default)("<div />").addClass("leplayer-error-display")}},{key:"onPlayerError",value:function(e,t){var n=t.error;this.message=n.message,this.element.show()}},{key:"message",set:function(e){this.element.html(e)}}]),t}(f.default);f.default.registerComponent("ErrorDisplay",p),t.default=p},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(2),s=o(u),c=n(4),f=o(c),p=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),n=s.default.extend({},{url:n.url},n);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.url=o.options.url,o}return l(t,e),a(t,[{key:"createElement",value:function(){return this.element=(0,s.default)("<div />").addClass("leplayer-poster"),this.element}},{key:"url",set:function(e){null!=e&&(this._url=e,this.element.css("background-image",'url("'+e+'")'))},get:function(){return this._url}}]),t}(f.default);f.default.registerComponent("Poster",p),t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var n={},o=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=o[0],i=void 0,l=0;l<o.length;l++)if(o[l][1]in document){i=o[l];break}if(i)for(var a=0;a<i.length;a++)n[r[a]]=i[a];t.default=n},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.