UNPKG

playable

Version:

Video player based on HTML5Video

1 lines 262 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.Playable={})}(this,function(t){"use strict";var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}var r,s=function(t){function e(e){var i=t.call(this,e)||this;return Object.defineProperty(i,"message",{enumerable:!1,value:e}),Object.defineProperty(i,"name",{enumerable:!1,value:i.constructor.name}),Error.captureStackTrace(i,i.constructor),i}return i(e,t),e}(Error),a=function(t){function e(e,i,n){return t.call(this,"The function "+e+" expected a "+i+", "+n+" given.")||this}return i(e,t),e}(s);!function(t){t.SINGLETON="singleton",t.TRANSIENT="transient",t.SCOPED="scoped"}(r||(r={}));var l=r,c="dependencies",p=function(t){var e=function(e){return t.lifetime=e,t};return{setLifetime:e,transient:function(){return e(l.TRANSIENT)},scoped:function(){return e(l.SCOPED)},singleton:function(){return e(l.SINGLETON)}}},u=function(t){return{resolve:function(){return t},lifetime:l.TRANSIENT}},h=function(t,e){if("function"!=typeof t)throw new a("asFunction","function",typeof t);var i={lifetime:l.TRANSIENT};e=n({},i,e);var o=d(t),r={resolve:o,lifetime:e.lifetime};return r.resolve=o.bind(r),n(r,p(r)),r},_=function(t,e){if("function"!=typeof t)throw new a("asClass","class",typeof t);var i={lifetime:l.TRANSIENT};e=n({},i,e);var o=d(function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new(t.bind.apply(t,[void 0].concat(e)))},t),r={resolve:o,lifetime:e.lifetime};return r.resolve=o.bind(r),n(r,p(r)),r};function d(t,e){e||(e=t);var i=e[c]||[];return function(e){if(i.length>0){var n=i.reduce(function(t,i){return t[i]=e.resolve(i),t},{});return t(n,e)}return t(e)}}var y={asValue:u,asFunction:h,asClass:_},m=function(t,e,i){(e=e.slice()).push(t);var n=e.join(" -> "),o="Could not resolve '"+t+"'.";return i&&(o+=" "+i+" \n\n Resolution path: "+n),o},f=function(t){function e(e,i,n){return t.call(this,m(e,i,n))||this}return i(e,t),e}(s);function v(t,e){var i;return"object"!=typeof t?n(((i={})[t]=e,i)):t}var b="__familyTree__",g=function(){function t(t,e){this._registrations={},this._resolutionStack=[],this.options=n({},t),this._parentContainer=e||null,this[b]=this._parentContainer?[this].concat(this._parentContainer[b]):[this],this.cache={}}return Object.defineProperty(t.prototype,"registrations",{get:function(){return n({},this._parentContainer&&this._parentContainer.registrations,this._registrations)},enumerable:!0,configurable:!0}),t.prototype._registerAs=function(t,e,i,o,r){var s=this,a=v(i,o);return Object.keys(a).forEach(function(i){var o=a[i];r=n({},r),!e&&Array.isArray(o)&&(r=n({},r,o[1]),o=o[0]),s.register(i,t(o,r))}),this},t.prototype.createScope=function(){return new t(this.options,this)},t.prototype.register=function(t,e){var i=this,n=v(t,e);return Object.keys(n).forEach(function(t){i._registrations[t]=n[t]}),this},t.prototype.registerClass=function(t,e,i){return this._registerAs(_,!1,t,e,i)},t.prototype.registerFunction=function(t,e,i){return this._registerAs(h,!1,t,e,i)},t.prototype.registerValue=function(t,e,i){return this._registerAs(u,!0,t,e,i)},t.prototype.resolve=function(t){var e=this[b][this[b].length-1];try{var i=this.registrations[t];if(this._resolutionStack.indexOf(t)>-1)throw new f(t,this._resolutionStack,"Cyclic dependencies detected.");if(!i)throw new f(t,this._resolutionStack);this._resolutionStack.push(t);var n=void 0,o=void 0;switch(i.lifetime){case l.TRANSIENT:o=i.resolve(this);break;case l.SINGLETON:void 0===(n=e.cache[t])?(o=i.resolve(this),e.cache[t]=o):o=n;break;case l.SCOPED:for(var r=0,s=this[b];r<s.length;r++){if(void 0!==(n=s[r].cache[t])){o=n;break}}void 0===n&&(o=i.resolve(this),this.cache[t]=o);break;default:throw new f(t,this._resolutionStack,'Unknown lifetime "'+i.lifetime+'"')}return this._resolutionStack.pop(),o}catch(t){throw this._resolutionStack=[],t}},t}();var E=n({createContainer:function(t,e){return new g(t,e)},Lifetime:l},y),w=/iphone/i,k=/ipod/i,x=/ipad/i,S=/(android)/i,T=/^((?!chrome|android).)*safari/i,C=function(){return!!window.MSStream},A=function(){return window.navigator&&window.navigator.userAgent},I=function(){return!C()&&w.test(A())},L=function(){return!C()&&k.test(A())},O=function(){return!C()&&x.test(A())},P=function(){return I()||L()||O()},N=function(){return S.test(A())},M=function(){return T.test(A())},D=function(t){return P()?function(t){return n({},t,{disableControlWithClickOnPlayer:!0,disableControlWithKeyboard:!0,hideMainUI:!0,nativeBrowserControls:!0})}(t):N()?function(t){return n({},t,{disableControlWithClickOnPlayer:!0,disableControlWithKeyboard:!0})}(t):t},R=function(t){return function(e,i,n){var o,r,s=t||i;if(e.___playerAPI||(e.___playerAPI={}),e.___playerAPI[s]&&(o=e.___playerAPI[s],r=n,o.value!==r.value||o.get!==r.get||o.set!==r.set))throw new Error('Method "'+s+'" for public API in '+e.constructor.name+" is already defined");e.___playerAPI[s]=n}},B=function(){function t(t,e,i,n,o){void 0===i&&(i=[]),void 0===n&&(n=[]),this._scope=e,this._scope.registerValue({config:D(t)}),this._scope.registerValue({themeConfig:o}),this._config=this._scope.resolve("config"),this._resolveAdditionalModules(n),this._resolveDefaultModules(i)}return t.prototype._resolveDefaultModules=function(t){var e=this;this._defaultModules=t.reduce(function(t,i){if(e._additionalModules[i])return t;var n=e._scope.resolve(i);return e._addPlayerAPIFromModule(n),t[i]=n,t},{})},t.prototype._resolveAdditionalModules=function(t){var e=this;this._additionalModules=t.reduce(function(t,i){var n=e._scope.resolve(i);return e._addPlayerAPIFromModule(n),t[i]=n,t},{})},t.prototype._getWrappedCallToModuleFunction=function(t,e){var i=this;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(i._destroyed)throw new Error("Player instance is destroyed");return e.apply(t,n)}},t.prototype._getPlayerAPIMethodDescriptor=function(t,e){var i={enumerable:!0,configurable:!0},n=e.get,o=e.set,r=e.value;return n&&(i.get=this._getWrappedCallToModuleFunction(t,n)),o&&(i.set=this._getWrappedCallToModuleFunction(t,o)),r&&(i.value=this._getWrappedCallToModuleFunction(t,r),i.writable=!0),i},t.prototype._getModuleApi=function(t){return t.getAPI?t.getAPI():t.___playerAPI},t.prototype._addPlayerAPIFromModule=function(t){var e=this,i=this._getModuleApi(t),n=t.getAPI?function(t){return Object.getOwnPropertyDescriptor(i,t)}:function(n){return e._getPlayerAPIMethodDescriptor(t,i[n])};i&&Object.keys(i).forEach(function(t){if(e[t])throw new Error("API method "+t+" is already defined in Player facade");Object.defineProperty(e,t,n(t))})},t.prototype._clearPlayerAPIForModule=function(t){var e=this,i=this._getModuleApi(t);i&&Object.keys(i).forEach(function(t){delete e[t]})},t.prototype.destroy=function(){var t=this;Object.keys(this._defaultModules).forEach(function(e){var i=t._defaultModules[e];t._clearPlayerAPIForModule(i),i.destroy()}),Object.keys(this._additionalModules).forEach(function(e){var i=t._additionalModules[e];t._clearPlayerAPIForModule(i),i.destroy&&i.destroy()}),this._defaultModules=null,this._additionalModules=null,this._config=null,this._scope=null,this._destroyed=!0},t}(),$=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var i=-1;return t.some(function(t,n){return t[0]===e&&(i=n,!0)}),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},e.prototype.set=function(e,i){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,n=t(i,e);~n&&i.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,n=this.__entries__;i<n.length;i++){var o=n[i];t.call(e,o[1],o[0])}},e}()}(),V="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,F="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),U="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(F):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},H=2;var W=20,Y=["top","right","bottom","left","width","height","size","weight"],z="undefined"!=typeof MutationObserver,j=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var i=!1,n=!1,o=0;function r(){i&&(i=!1,t()),n&&a()}function s(){U(r)}function a(){var t=Date.now();if(i){if(t-o<H)return;n=!0}else i=!0,n=!1,setTimeout(s,e);o=t}return a}(this.refresh.bind(this),W)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},t.prototype.connect_=function(){V&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),z?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){V&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;Y.some(function(t){return!!~i.indexOf(t)})&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),K=function(t,e){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},G=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||F},q=et(0,0,0,0);function X(t){return parseFloat(t)||0}function Q(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce(function(e,i){return e+X(t["border-"+i+"-width"])},0)}function Z(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return q;var n=G(t).getComputedStyle(t),o=function(t){for(var e={},i=0,n=["top","right","bottom","left"];i<n.length;i++){var o=n[i],r=t["padding-"+o];e[o]=X(r)}return e}(n),r=o.left+o.right,s=o.top+o.bottom,a=X(n.width),l=X(n.height);if("border-box"===n.boxSizing&&(Math.round(a+r)!==e&&(a-=Q(n,"left","right")+r),Math.round(l+s)!==i&&(l-=Q(n,"top","bottom")+s)),!function(t){return t===G(t).document.documentElement}(t)){var c=Math.round(a+r)-e,p=Math.round(l+s)-i;1!==Math.abs(c)&&(a-=c),1!==Math.abs(p)&&(l-=p)}return et(o.left,o.top,a,l)}var J="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof G(t).SVGGraphicsElement}:function(t){return t instanceof G(t).SVGElement&&"function"==typeof t.getBBox};function tt(t){return V?J(t)?function(t){var e=t.getBBox();return et(0,0,e.width,e.height)}(t):Z(t):q}function et(t,e,i,n){return{x:t,y:e,width:i,height:n}}var it=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=et(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=tt(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),nt=function(){return function(t,e){var i,n,o,r,s,a,l,c=(n=(i=e).x,o=i.y,r=i.width,s=i.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(a.prototype),K(l,{x:n,y:o,width:r,height:s,top:o,right:n+r,bottom:s+o,left:n}),l);K(this,{target:t,contentRect:c})}}(),ot=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new $,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof G(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new it(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof G(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new nt(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),rt="undefined"!=typeof WeakMap?new WeakMap:new $,st=function(){return function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=j.getInstance(),n=new ot(e,i,this);rt.set(this,n)}}();["observe","unobserve","disconnect"].forEach(function(t){st.prototype[t]=function(){var e;return(e=rt.get(this))[t].apply(e,arguments)}});var at=void 0!==F.ResizeObserver?F.ResizeObserver:st,lt=0,ct=0,pt=["touchstart","pointerdown","MSPointerDown","mousedown"],ut=["touchend","touchcancel","pointerup","MSPointerUp","pointercancel","MSPointerCancel","mouseup"];function ht(){lt=0,ct=0}function _t(t){!1!==t.isPrimary&&(lt+=1)}function dt(t){!1!==t.isPrimary&&(t.touches?lt=t.touches.length:(window.setImmediate||window.setTimeout)(function(){lt=Math.max(lt-1,0)}))}function yt(t){switch(t.keyCode||t.which){case 16:case 17:case 18:case 91:case 93:return}ct+=1}function mt(t){switch(t.keyCode||t.which){case 16:case 17:case 18:case 91:case 93:return}(window.setImmediate||window.setTimeout)(function(){ct=Math.max(ct-1,0)})}function ft(){return{pointer:Boolean(lt),key:Boolean(ct)}}var vt,bt={engage:function(){return window.addEventListener("blur",ht,!1),document.documentElement.addEventListener("keydown",yt,!0),document.documentElement.addEventListener("keyup",mt,!0),pt.forEach(function(t){document.documentElement.addEventListener(t,_t,!0)}),ut.forEach(function(t){document.documentElement.addEventListener(t,dt,!0)}),{get:ft}},disengage:function(){lt=ct=0,window.removeEventListener("blur",ht,!1),document.documentElement.removeEventListener("keydown",yt,!0),document.documentElement.removeEventListener("keyup",mt,!0),pt.forEach(function(t){document.documentElement.removeEventListener(t,_t,!0)}),ut.forEach(function(t){document.documentElement.removeEventListener(t,dt,!0)})}},gt="undefined"!=typeof document&&"onfocusin"in document,Et=gt?"focusin":"focus",wt=gt?"focusout":"blur",kt=null,xt=null,St={pointer:!1,key:!1,script:!1,initial:!1};function Tt(t){var e="";if(t.type===Et){var i=vt.get();e=xt||i.pointer&&"pointer"||i.key&&"key"||"script"}else"initial"===t.type&&(e="initial");document.documentElement.setAttribute("data-playable-focus-source",e),t.type!==wt&&(St[e]=!0,kt=e)}function Ct(){return kt}function At(t){return St[t]}function It(t){xt=t}function Lt(){xt=!1}var Ot={engage:function(){return document.documentElement.addEventListener(Et,Tt,!0),document.documentElement.addEventListener(wt,Tt,!0),vt=bt.engage(),Tt({type:"initial"}),{used:At,current:Ct,lock:It,unlock:Lt}},disengage:function(){Tt({type:wt}),kt=xt=null,Object.keys(St).forEach(function(t){St[t]=!1}),bt.disengage(),document.documentElement.removeEventListener(Et,Tt,!0),document.documentElement.removeEventListener(wt,Tt,!0),document.documentElement.removeAttribute("data-playable-focus-source")}},Pt="undefined"!=typeof window&&window.document&&"unknown"!=typeof window.document.activeElement;var Nt,Mt=function(t,e,i){var n,o,r,s,a=(s=function(){var s,a=Pt?document.activeElement:null;if(n=!1,o!==a){if(o=a,s=t,Array.prototype.slice.call(s.getElementsByClassName("focus-within")).forEach(function(t){t.classList.remove("focus-within")}),!t.contains(a))return void(r&&(r=!1,i()));r||(r=!0,e()),function(t,e){for(var i=e;i!==t&&void 0!==i.classList;)i.classList.add("focus-within"),i=i.parentNode}(t,a)}},function(){n||(requestAnimationFrame(s),n=!0)});return t.addEventListener("focus",a,!0),t.addEventListener("blur",a,!0),a(),function(){t.removeEventListener("focus",a,!0),t.removeEventListener("blur",a,!0)}};(Nt=t.MEDIA_STREAM_TYPES||(t.MEDIA_STREAM_TYPES={})).MP4="MP4",Nt.WEBM="WEBM",Nt.HLS="HLS",Nt.DASH="DASH",Nt.OGG="OGG",Nt.MOV="MOV",Nt.MKV="MKV";var Dt,Rt,Bt={"application/x-mpegURL":t.MEDIA_STREAM_TYPES.HLS,"application/vnd.apple.mpegURL":t.MEDIA_STREAM_TYPES.HLS,"application/dash+xml":t.MEDIA_STREAM_TYPES.DASH,"video/mp4":t.MEDIA_STREAM_TYPES.MP4,"video/x-mp4":t.MEDIA_STREAM_TYPES.MP4,"x-video/mp4":t.MEDIA_STREAM_TYPES.MP4,"video/webm":t.MEDIA_STREAM_TYPES.WEBM,"video/ogg":t.MEDIA_STREAM_TYPES.OGG,"video/quicktime":t.MEDIA_STREAM_TYPES.MOV,"video/x-matroska":t.MEDIA_STREAM_TYPES.MKV};(Dt=t.MEDIA_STREAM_DELIVERY_PRIORITY||(t.MEDIA_STREAM_DELIVERY_PRIORITY={}))[Dt.NATIVE_PROGRESSIVE=0]="NATIVE_PROGRESSIVE",Dt[Dt.ADAPTIVE_VIA_MSE=1]="ADAPTIVE_VIA_MSE",Dt[Dt.NATIVE_ADAPTIVE=2]="NATIVE_ADAPTIVE",Dt[Dt.FORCED=3]="FORCED",function(t){t.PLAY_CLICK="ui-events/play-click",t.PLAY_OVERLAY_CLICK="ui-events/play-overlay-click",t.PAUSE_CLICK="ui-events/pause-click",t.PROGRESS_CHANGE="ui-events/progress-change",t.PROGRESS_DRAG_STARTED="ui-events/progress-drag-started",t.PROGRESS_DRAG_ENDED="ui-events/progress-drag-ended",t.PROGRESS_SYNC_BUTTON_MOUSE_ENTER="ui-events/progress-sync-button-mouse-enter",t.PROGRESS_SYNC_BUTTON_MOUSE_LEAVE="ui-events/progress-sync-button-mouse-leave",t.PROGRESS_USER_PREVIEWING_FRAME="ui-events/progress-user-previewing-frame",t.VOLUME_CHANGE="ui-events/volume-change",t.MUTE_CLICK="ui-events/mute-click",t.UNMUTE_CLICK="ui-events/unmute-click",t.ENTER_FULL_SCREEN_CLICK="ui-events/enter-full-screen-click",t.EXIT_FULL_SCREEN_CLICK="ui-events/exit-full-screen-click",t.ENTER_PICTURE_IN_PICTURE_CLICK="ui-events/enter-picture-in-picture-click",t.EXIT_PICTURE_IN_PICTURE_CLICK="ui-events/exit-picture-in-picture-click",t.MOUSE_ENTER_ON_PLAYER="ui-events/mouse-enter-on-player",t.MOUSE_MOVE_ON_PLAYER="ui-events/mouse-move-on-player",t.MOUSE_LEAVE_ON_PLAYER="ui-events/mouse-leave-on-player",t.FOCUS_ENTER_ON_PLAYER="ui-events/focus-enter-on-player",t.FOCUS_LEAVE_ON_PLAYER="ui-events/focus-leave-on-player",t.MAIN_BLOCK_HIDE="ui-events/main-block-hide",t.MAIN_BLOCK_SHOW="ui-events/main-block-show",t.LOADER_SHOW="ui-events/loader-show",t.LOADER_HIDE="ui-events/loader-hide",t.LOADING_COVER_SHOW="ui-events/loading-cover-show",t.LOADING_COVER_HIDE="ui-events/loading-cover-hide",t.TOGGLE_PLAYBACK_WITH_KEYBOARD="ui-events/toggle-playback-with-keyboard",t.GO_BACKWARD_WITH_KEYBOARD="ui-events/go-backward-with-keyboard",t.GO_FORWARD_WITH_KEYBOARD="ui-events/go-forward-with-keyboard",t.INCREASE_VOLUME_WITH_KEYBOARD="ui-events/increase-volume-with-keyboard",t.DECREASE_VOLUME_WITH_KEYBOARD="ui-events/decrease-volume-with-keyboard",t.MUTE_WITH_KEYBOARD="ui-events/mute-with-keyboard",t.UNMUTE_WITH_KEYBOARD="ui-events/unmute-with-keyboard",t.HIDE_INTERACTION_INDICATOR="ui-events/hide-interaction-indicator",t.PLAY_WITH_SCREEN_CLICK="ui-events/play-with-screen-click",t.PAUSE_WITH_SCREEN_CLICK="ui-events/pause-with-screen-click",t.ENTER_FULL_SCREEN_WITH_SCREEN_CLICK="ui-events/enter-full-screen-with-screen-click",t.EXIT_FULL_SCREEN_WITH_SCREEN_CLICK="ui-events/exit-full-screen-with-screen-click",t.CONTROL_DRAG_START="ui-events/control-drag-start",t.CONTROL_DRAG_END="ui-events/control-drag-end",t.KEYBOARD_KEYDOWN_INTERCEPTED="ui-events/keyboard-keydown-intercepted",t.FULL_SCREEN_STATE_CHANGED="ui-events/full-screen-state-changed",t.PICTURE_IN_PICTURE_STATUS_CHANGE="ui-events/picture-in-picture-status-changed",t.RESIZE="ui-events/resize"}(Rt||(Rt={}));var $t,Vt=Rt;!function(t){t.ERROR="video-events/error",t.STATE_CHANGED="video-events/state-changed",t.LIVE_STATE_CHANGED="video-events/live-state-changed",t.DYNAMIC_CONTENT_ENDED="video-events/dynamic-content-ended",t.CHUNK_LOADED="video-events/chunk-loaded",t.CURRENT_TIME_UPDATED="video-events/current-time-updated",t.DURATION_UPDATED="video-events/duration-updated",t.SOUND_STATE_CHANGED="video-events/sound-state-changed",t.VOLUME_CHANGED="video-events/volume-changed",t.MUTE_CHANGED="video-events/mute-changed",t.SEEK_IN_PROGRESS="video-events/seek-in-progress",t.UPLOAD_STALLED="video-events/upload-stalled",t.UPLOAD_SUSPEND="video-events/upload-suspend",t.PLAY_REQUEST="video-events/play-request",t.PLAY_ABORTED="video-events/play-aborted",t.RESET="video-events/reset-playback"}($t||($t={}));var Ft,Ut=$t;!function(t){t.SRC_PARSE="error-src-parse",t.MANIFEST_LOAD="error-manifest-load",t.MANIFEST_PARSE="error-manifest-parse",t.MANIFEST_INCOMPATIBLE="error-manifest-incompatible",t.LEVEL_LOAD="error-level-load",t.CONTENT_LOAD="error-content-load",t.CONTENT_PARSE="error-content-parse",t.MEDIA="error-media",t.UNKNOWN="error-unknown"}(Ft||(Ft={}));var Ht,Wt=Ft;!function(t){t.LOGO_LABEL="logo-label",t.LOGO_TOOLTIP="logo-tooltip",t.LIVE_INDICATOR_TEXT="live-indicator-text",t.LIVE_SYNC_LABEL="live-sync-button-label",t.LIVE_SYNC_TOOLTIP="live-sync-button-tooltip",t.ENTER_FULL_SCREEN_LABEL="enter-full-screen-label",t.ENTER_FULL_SCREEN_TOOLTIP="enter-full-screen-tooltip",t.EXIT_FULL_SCREEN_LABEL="exit-full-screen-label",t.EXIT_FULL_SCREEN_TOOLTIP="exit-full-screen-tooltip",t.ENTER_PICTURE_IN_PICTURE_LABEL="enter-picture-in-picture-button-label",t.ENTER_PICTURE_IN_PICTURE_TOOLTIP="enter-picture-in-picture-button-tooltip",t.EXIT_PICTURE_IN_PICTURE_LABEL="exit-picture-in-picture-button-label",t.EXIT_PICTURE_IN_PICTURE_TOOLTIP="exit-picture-in-picture-button-tooltip",t.PLAY_CONTROL_LABEL="play-control-label",t.PAUSE_CONTROL_LABEL="pause-control-label",t.PROGRESS_CONTROL_LABEL="progress-control-label",t.PROGRESS_CONTROL_VALUE="progress-control-value",t.UNMUTE_CONTROL_LABEL="unmute-control-label",t.UNMUTE_CONTROL_TOOLTIP="unmute-control-label",t.MUTE_CONTROL_LABEL="mute-control-label",t.MUTE_CONTROL_TOOLTIP="mute-control-tooltip",t.VOLUME_CONTROL_LABEL="volume-control-label",t.VOLUME_CONTROL_VALUE="volume-control-value",t.DOWNLOAD_BUTTON_LABEL="download-button-label",t.DOWNLOAD_BUTTON_TOOLTIP="download-button-tooltip"}(Ht||(Ht={}));var Yt,zt=Ht;!function(t){t.SRC_SET="engine-state/src-set",t.LOAD_STARTED="engine-state/load-started",t.METADATA_LOADED="engine-state/metadata-loaded",t.READY_TO_PLAY="engine-state/ready-to-play",t.SEEK_IN_PROGRESS="engine-state/seek-in-progress",t.PLAY_REQUESTED="engine-state/play-requested",t.WAITING="engine-state/waiting",t.PLAYING="engine-state/playing",t.PAUSED="engine-state/paused",t.ENDED="engine-state/ended"}(Yt||(Yt={}));var jt,Kt=Yt;!function(t){t.NONE="live-state/none",t.INITIAL="live-state/initial",t.NOT_SYNC="live-state/not-sync",t.SYNC="live-state/sync",t.ENDED="live-state/ended"}(jt||(jt={}));var Gt=jt;function qt(t){if(!t)throw new Error("HTML provided to htmlToElement is empty");var e=document.createElement("div");if(e.innerHTML=t.trim(),e.childElementCount>1)throw new Error("HTML provided to htmlToElement doesn't have root element");return e.firstChild}function Xt(t){return'<div data-playable-hook="player-container" dir="ltr" data-playable-dir="'+t.direction+'" tabindex="0" class="'+t.styles.container+'"></div>'}var Qt=Xt.default?Xt.default:Xt;function Zt(t,e){return t(e={exports:{}},e.exports),e.exports}var Jt=Zt(function(t){!function(){var e={}.hasOwnProperty;function i(){for(var t=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var s=i.apply(null,o);s&&t.push(s)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var a in o)e.call(o,a)&&o[a]&&t.push(a);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):window.classNames=i}()});var te=function(){function t(t){this._themeStyles={};var e=this.constructor._moduleTheme;t&&e&&(t.registerModuleTheme(this,e),this._themeStyles=t.get(this))}return t.setTheme=function(t){this._moduleTheme=t},t.extendStyleNames=function(t){this._styles=function(t,e){var i=n({},t);return Object.keys(e).forEach(function(t){i[t]=i[t]?Jt(i[t],e[t]):e[t]}),i}(this._styles,t)},t.resetStyles=function(){this._styles={}},Object.defineProperty(t.prototype,"themeStyles",{get:function(){return this._themeStyles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"styleNames",{get:function(){return this.constructor._styles||{}},enumerable:!0,configurable:!0}),t._styles={},t}(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(te);function ie(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}ie(".__3nLjS{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0;cursor:pointer;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:opacity;transition-property:opacity;opacity:1;border:0;border-radius:0;outline:none;background-color:transparent;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.__3nLjS:hover{opacity:.7}.__10ZXK{visibility:hidden!important;width:0!important;min-width:0!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;opacity:0!important}.___RXkJ{font-family:HelveticaNeueW01-45Ligh,HelveticaNeueW02-45Ligh,HelveticaNeueW10-45Ligh,Helvetica Neue,Helvetica,Arial,\\\\30e1\\30a4\\30ea\\30aa,meiryo,\\\\30d2\\30e9\\30ae\\30ce\\89d2\\30b4 pro w3,hiragino kaku gothic pro;position:relative;z-index:0;display:block;overflow:hidden;height:inherit;outline:none}.___RXkJ button{font-family:inherit;font-size:100%;line-height:1.15;overflow:visible;margin:0;text-transform:none;-webkit-appearance:button}.___RXkJ button::-moz-focus-inner{padding:0;border-style:none}.___RXkJ button:-moz-focusring{outline:1px dotted ButtonText}[data-playable-hook=player-container].___RXkJ [data-playable-component],[data-playable-hook=player-container].___RXkJ [data-playable-component] *,[data-playable-hook=player-container].___RXkJ [data-playable-component] :after,[data-playable-hook=player-container].___RXkJ [data-playable-component] :before{-webkit-box-sizing:content-box!important;box-sizing:content-box!important;outline:none!important}.__3oMwD,.__33wu6{width:100%!important;min-width:100%!important;height:100%!important;min-height:100%!important}[data-playable-focus-source=key] [data-playable-hook=player-container] button.focus-within,[data-playable-focus-source=key] [data-playable-hook=player-container] img.focus-within,[data-playable-focus-source=key] [data-playable-hook=player-container] input.focus-within,[data-playable-focus-source=script] [data-playable-hook=player-container] button.focus-within,[data-playable-focus-source=script] [data-playable-hook=player-container] img.focus-within,[data-playable-focus-source=script] [data-playable-hook=player-container] input.focus-within{-webkit-box-shadow:0 0 0 2px rgba(56,153,236,.8);box-shadow:0 0 0 2px rgba(56,153,236,.8)}");var ne=function(t){function e(e){var i=t.call(this)||this,n=e.width,o=e.height,r=e.fillAllSpace,s=e.callbacks,a=e.rtl;return i._callbacks=s,i._$rootElement=qt(Qt({styles:i.styleNames})),i.setFillAllSpaceFlag(r),i.setRtl(a),i.setWidth(n),i.setHeight(o),i._bindEvents(),i}return i(e,t),e.prototype._bindEvents=function(){this._$rootElement.addEventListener("mouseenter",this._callbacks.onMouseEnter),this._$rootElement.addEventListener("mousemove",this._callbacks.onMouseMove),this._$rootElement.addEventListener("mouseleave",this._callbacks.onMouseLeave)},e.prototype._unbindEvents=function(){this._$rootElement.removeEventListener("mouseenter",this._callbacks.onMouseEnter),this._$rootElement.removeEventListener("mousemove",this._callbacks.onMouseMove),this._$rootElement.removeEventListener("mouseleave",this._callbacks.onMouseLeave)},e.prototype.setWidth=function(t){if(t){var e=t+"px";this._$rootElement.style.width=e,this._$rootElement.style.minWidth=e}},e.prototype.setHeight=function(t){if(t){var e=t+"px";this._$rootElement.style.height=e,this._$rootElement.style.minHeight=e}},e.prototype.getWidth=function(){return this._$rootElement.offsetWidth},e.prototype.getHeight=function(){return this._$rootElement.offsetHeight},e.prototype.show=function(){this._$rootElement.classList.remove(this.styleNames.hidden)},e.prototype.hide=function(){this._$rootElement.classList.add(this.styleNames.hidden)},e.prototype.appendComponentElement=function(t){this._$rootElement.appendChild(t)},e.prototype.getElement=function(){return this._$rootElement},e.prototype.setFullScreenState=function(t){t?(this._$rootElement.setAttribute("data-playable-in-full-screen","true"),this._$rootElement.classList.add(this.styleNames.fullScreen)):(this._$rootElement.setAttribute("data-playable-in-full-screen","false"),this._$rootElement.classList.remove(this.styleNames.fullScreen))},e.prototype.setFillAllSpaceFlag=function(t){void 0===t&&(t=!1),t?this._$rootElement.classList.add(this.styleNames.fillAllSpace):this._$rootElement.classList.remove(this.styleNames.fillAllSpace)},e.prototype.setRtl=function(t){this._$rootElement.setAttribute("data-playable-dir",t?"rtl":"ltr")},e.prototype.destroy=function(){this._unbindEvents(),this._$rootElement.parentNode&&this._$rootElement.parentNode.removeChild(this._$rootElement),this._$rootElement=null},e}(ee);function oe(t,e,i){return Array.prototype.reduce.call(t,e,i)}function re(t,e,i){for(var n=e.exec(t);null!==n;)i(n),n=e.exec(t)}ne.extendStyleNames({controlButton:"__3nLjS",hidden:"__10ZXK",container:"___RXkJ",fillAllSpace:"__33wu6",fullScreen:"__3oMwD"});var se,ae=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector"];if("undefined"!=typeof HTMLElement)for(var le=0;le<ae.length&&!(se=Element.prototype[ae[le]]);le++);var ce=se?function(t,e){return se.call(t,e)}:function(t,e){return-1!==Array.prototype.indexOf.call(document.querySelectorAll(e),t)},pe=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:[a-z-]+-)?(?:min|max)-width[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,ue=/\[[\s\t]*?(?:([a-z-]+)-)?(min|max)-width[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function he(t){var e=[];return-1===t.indexOf("min-width")&&-1===t.indexOf("max-width")?[]:(re(t=t.replace(/'/g,'"'),pe,function(t){var i=t.slice(1),n=i[0],o=i[1],r=n+i[2];re(o,ue,function(t){var i=t.slice(1),n=i[0],o=void 0===n?"":n,s=i[1],a=i[2];e.push({selector:r,prefix:o,mode:s,width:parseInt(a,10)})})}),e)}function _e(){return oe(document.styleSheets,function(t,e){try{var i=e.cssRules||e.rules;if(i)return t.concat(function(t){return oe(t,function(t,e){if(1===e.type){var i=e.selectorText||e.cssText;return t.concat(he(i))}return t},[])}(i));if(e.cssText)return t.concat(he(e.cssText))}catch(t){}return t},[])}var de="data-playable",ye=function(){function t(t,e){var i=(void 0===e?{}:e).prefix,n=void 0===i?de:i;this._element=t,this._queryPrefix=n,this._queries=[]}return t.prototype._getQueryAttributeValue=function(t,e){return this._queries.filter(function(i){return i.mode===t&&("max"===t&&i.width>=e||"min"===t&&i.width<=e)}).map(function(t){return t.width+"px"}).join(" ")},t.prototype._setQueryAttribute=function(t,e){var i=this._queryPrefix?this._queryPrefix+"-"+t+"-width":t+"-width",n=this._getQueryAttributeValue(t,e);n?this._element.setAttribute(i,n):this._element.removeAttribute(i)},t.prototype.getQueries=function(){this._queries=function(t,e){void 0===e&&(e="");var i=new Map,n=[];return _e().forEach(function(o){i.has(o.selector)||i.set(o.selector,ce(t,o.selector)),i.get(o.selector)&&(o.prefix!==e||n.some(function(t){return t.mode===o.mode&&t.width===o.width})||n.push({mode:o.mode,width:o.width}))}),n.sort(function(t,e){return t.width-e.width})}(this._element,this._queryPrefix)},t.prototype.setWidth=function(t){this._setQueryAttribute("min",t),this._setQueryAttribute("max",t)},t.prototype.destroy=function(){this._element=null},t}(),me=!1,fe=!1,ve=function(){function t(t){var e=t.eventEmitter,i=t.config;this._eventEmitter=e,this.isHidden=!1,this._bindCallbacks(),this._initUI(i),this._bindEvents()}return t.prototype.getElement=function(){return this.view.getElement()},t.prototype._bindCallbacks=function(){this._onResized=this._onResized.bind(this),this._broadcastMouseEnter=this._broadcastMouseEnter.bind(this),this._broadcastMouseMove=this._broadcastMouseMove.bind(this),this._broadcastMouseLeave=this._broadcastMouseLeave.bind(this),this._broadcastFocusEnter=this._broadcastFocusEnter.bind(this),this._broadcastFocusLeave=this._broadcastFocusLeave.bind(this)},t.prototype._bindEvents=function(){this._unbindEvents=this._eventEmitter.bindEvents([[Vt.FULL_SCREEN_STATE_CHANGED,this.view.setFullScreenState,this.view]],this)},t.prototype._initUI=function(t){this.view=new ne({callbacks:{onMouseEnter:this._broadcastMouseEnter,onMouseLeave:this._broadcastMouseLeave,onMouseMove:this._broadcastMouseMove},width:t.width||null,height:t.height||null,fillAllSpace:t.fillAllSpace||me,rtl:t.rtl||fe}),this._elementQueries=new ye(this.getElement()),this._resizeObserver=new at(this._onResized),this._resizeObserver.observe(this.getElement())},t.prototype.appendComponentElement=function(t){this.view.appendComponentElement(t)},t.prototype._broadcastMouseEnter=function(){this._eventEmitter.emitAsync(Vt.MOUSE_ENTER_ON_PLAYER)},t.prototype._broadcastMouseMove=function(){this._eventEmitter.emitAsync(Vt.MOUSE_MOVE_ON_PLAYER)},t.prototype._broadcastMouseLeave=function(){this._eventEmitter.emitAsync(Vt.MOUSE_LEAVE_ON_PLAYER)},t.prototype._broadcastFocusEnter=function(){this._eventEmitter.emitAsync(Vt.FOCUS_ENTER_ON_PLAYER)},t.prototype._broadcastFocusLeave=function(){this._eventEmitter.emitAsync(Vt.FOCUS_LEAVE_ON_PLAYER)},t.prototype._enableFocusInterceptors=function(){this._disengageFocusWithin||(this._disengageFocusWithin=Mt(this.getElement(),this._broadcastFocusEnter,this._broadcastFocusLeave)),this._disengageFocusSource||(Ot.engage(),this._disengageFocusSource=Ot.disengage)},t.prototype._disableFocusInterceptors=function(){this._disengageFocusSource&&(this._disengageFocusSource(),this._disengageFocusSource=null),this._disengageFocusWithin&&(this._disengageFocusWithin(),this._disengageFocusWithin=null)},t.prototype._onResized=function(){var t=this.view.getWidth(),e=this.view.getHeight();this._elementQueries.setWidth(t),this._eventEmitter.emitAsync(Vt.RESIZE,{width:t,height:e})},t.prototype.attachToElement=function(t){this._enableFocusInterceptors(),t.appendChild(this.getElement()),this._elementQueries.getQueries()},t.prototype.setWidth=function(t){this.view.setWidth(t)},t.prototype.getWidth=function(){return this.view.getWidth()},t.prototype.setHeight=function(t){this.view.setHeight(t)},t.prototype.getHeight=function(){return this.view.getHeight()},t.prototype.setFillAllSpace=function(t){this.view.setFillAllSpaceFlag(t)},t.prototype.setRtl=function(t){this.view.setRtl(t)},t.prototype.hide=function(){this.isHidden=!0,this.view.hide()},t.prototype.show=function(){this.isHidden=!1,this.view.show()},t.prototype.destroy=function(){this._unbindEvents(),this._disableFocusInterceptors(),this._resizeObserver.unobserve(this.getElement()),this._elementQueries.destroy(),this.view.destroy()},t.moduleName="rootContainer",t.dependencies=["eventEmitter","config"],o([R()],t.prototype,"getElement",null),o([R()],t.prototype,"attachToElement",null),o([R()],t.prototype,"setWidth",null),o([R()],t.prototype,"getWidth",null),o([R()],t.prototype,"setHeight",null),o([R()],t.prototype,"getHeight",null),o([R()],t.prototype,"setFillAllSpace",null),o([R()],t.prototype,"setRtl",null),o([R()],t.prototype,"hide",null),o([R()],t.prototype,"show",null),t}(),be=Zt(function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function o(t,e,n,o,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(n,o||t,r),a=i?i+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],s]:t._events[a].push(s):(t._events[a]=s,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},s.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,s=new Array(r);o<r;o++)s[o]=n[o].fn;return s},s.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,o,r,s){var a=i?i+t:t;if(!this._events[a])return!1;var l,c,p=this._events[a],u=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),u){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,n),!0;case 4:return p.fn.call(p.context,e,n,o),!0;case 5:return p.fn.call(p.context,e,n,o,r),!0;case 6:return p.fn.call(p.context,e,n,o,r,s),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];p.fn.apply(p.context,l)}else{var h,_=p.length;for(c=0;c<_;c++)switch(p[c].once&&this.removeListener(t,p[c].fn,void 0,!0),u){case 1:p[c].fn.call(p[c].context);break;case 2:p[c].fn.call(p[c].context,e);break;case 3:p[c].fn.call(p[c].context,e,n);break;case 4:p[c].fn.call(p[c].context,e,n,o);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];p[c].fn.apply(p[c].context,l)}}return!0},s.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},s.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},s.prototype.removeListener=function(t,e,n,o){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return r(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||o&&!a.once||n&&a.context!==n||r(this,s);else{for(var l=0,c=[],p=a.length;l<p;l++)(a[l].fn!==e||o&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[s]=1===c.length?c[0]:c:r(this,s)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&r(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,t.exports=s}).EventEmitter,ge=!!function(){if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;throw new Error("unable to locate global object")}().Promise,Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.on=function(e,i,n){return t.prototype.on.call(this,e,i,n)},e.prototype.once=function(e,i,n){return t.prototype.once.call(this,e,i,n)},e.prototype.off=function(e,i,n,o){return t.prototype.off.call(this,e,i,n,o)},e.prototype.bindEvents=function(t,e){var i=this,n=[];return t.forEach(function(t){var o=t[0],r=t[1],s=t[2],a=void 0===s?e:s;i.on(o,r,a),n.push(function(){i.off(o,r,a)})}),function(){n.forEach(function(t){t()})}},e.prototype.emitAsync=function(e){for(var i=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(ge)return Promise.resolve().then(function(){return t.prototype.emit.apply(i,[e].concat(n))});setImmediate?setImmediate(function(){return t.prototype.emit.apply(i,[e].concat(n))}):setTimeout(function(){return t.prototype.emit.apply(i,[e].concat(n))})},e.prototype.destroy=function(){this.removeAllListeners()},e.moduleName="eventEmitter",o([R()],e.prototype,"on",null),o([R()],e.prototype,"once",null),o([R()],e.prototype,"off",null),e}(be),we=function(){function t(t){var e=t.eventEmitter,i=t.nativeOutput,n=t.config;this._eventEmitter=e,this._config=n,this._defaultOutput=i,this._output=i,this._applyConfig(this._config)}return t.prototype._applyConfig=function(t){void 0===t&&(t={});var e=t.preload,i=t.autoplay,n=t.loop,o=t.muted,r=t.volume,s=t.playsinline,a=t.crossOrigin,l=t.src;this.setPreload(e),this.setAutoplay(i),this.setLoop(n),this.setMute(o),this.setVolume(r),this.setPlaysinline(s),this.setCrossOrigin(a),l&&this.setSrc(l)},t.prototype.getElement=function(){return this._output.getElement()},Object.defineProperty(t.prototype,"isDynamicContent",{get:function(){return this._output.isDynamicContent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDynamicContentEnded",{get:function(){return this._output.isDynamicContentEnded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSeekAvailable",{get:function(){return this._output.isSeekAvailable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isMetadataLoaded",{get:function(){return this._output.isMetadataLoaded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPreloadActive",{get:function(){return this._output.isPreloadActive},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAutoPlayActive",{get:function(){return this._output.isAutoPlayActive},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSyncWithLive",{get:function(){return this._output.isSyncWithLive},enumerable:!0,configurable:!0}),t.prototype.setSrc=function(t,e){t!==this.getSrc()&&this._output.setSrc(t,e)},t.prototype.getSrc=function(){return this._output.src},t.prototype.reset=function(){this.pause(),this.seekTo(0),this._eventEmitter.emitAsync(Ut.RESET)},t.prototype.play=function(){this._output.play()},t.prototype.pause=function(){this._output.pause()},t.prototype.togglePlayback=function(){this.isPaused?this.play():this.pause()},t.prototype.resetPlayback=function(){this.pause(),this.seekTo(0),this._eventEmitter.emitAsync(Ut.RESET)},Object.defineProperty(t.prototype,"isPaused",{get:function(){return this._output.isPaused},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnded",{get:function(){return this._output.isEnded},enumerable:!0,configurable:!0}),t.prototype.syncWithLive=function(){this._output.syncWithLive()},t.prototype.seekForward=function(t){var e=this.getDuration();if(e){var i=this.getCurrentTime();this.seekTo(Math.min(i+t,e))}},t.prototype.seekBackward=function(t){if(this.getDuration()){var e=this.getCurrentTime();this.seekTo(Math.max(e-t,0))}},t.prototype.setVolume=function(t){var e=Number(t),i=isNaN(e)?1:Math.max(0,Math.min(Number(t)/100,1));this._output.setVolume(i)},t.prototype.getVolume=function(){return 100*this._output.volume},t.prototype.increaseVolume=function(t){this.setVolume(this.getVolume()+t)},t.prototype.decreaseVolume=function(t){this.setVolume(this.getVolume()-t)},t.prototype.setMute=function(t){this._output.setMute(t)},t.prototype.mute=function(){this.setMute(!0)},t.prototype.unmute=function(){this.setMute(!1)},Object.defineProperty(t.prototype,"isMuted",{get:function(){return this._output.isMuted},enumerable:!0,configurable:!0}),t.prototype.setAutoplay=function(t){this._output.setAutoplay(t)},t.prototype.getAutoplay=function(){return this._output.isAutoplay},t.prototype.setLoop=function(t){this._output.setLoop(t)},t.prototype.getLoop=function(){return this._output.isLoop},t.prototype.setPlaybackRate=function(t){this._output.setPlaybackRate(t)},t.prototype.getPlaybackRate=function(){return this._output.playbackRate},t.prototype.setPreload=function(t){this._output.setPreload(t)},t.prototype.getPreload=function(){return this._output.preload},t.prototype.getCurrentTime=function(){return this._output.currentTime},t.prototype.seekTo=function(t){this._output.setCurrentTime(t)},t.prototype.getDuration=function(){return this._output.duration||0},t.prototype.getVideoWidth=function(){return this._output.videoWidth},t.prototype.getVideoHeight=function(){return this._output.videoHeight},t.prototype.getBuffered=function(){return this._output.buffered},t.prototype.setPlaysinline=function(t){this._output.setInline(t)},t.prototype.getPlaysinline=function(){return this._output.isInline},t.prototype.setCrossOrigin=function(t){this._output.setCrossOrigin(t)},t.prototype.getCrossOrigin=function(){return this._output.crossOrigin},t.prototype.getCurrentState=function(){return this._output.currentState},t.prototype.getDebugInfo=function(){return this._output.getDebugInfo()},t.prototype.destroy=function(){},t.prototype.changeOutput=function(t,e){var i=this.getSrc();return this._output.pause(),this._output=t,this._applyConfig(this._config),this._output.setSrc(i,e)},t.prototype.resetOutput=function(){var t=!this._output.isPaused,e=this._output.currentTime;this._output=this._defaultOutput,this._output.setCurrentTime(e),t&&this._output.play()},t.moduleName="engine",t.dependencies=["eventEmitter","config","nativeOutput"],o([R()],t.prototype,"setSrc",null),o([R()],t.prototype,"getSrc",null),o([R()],t.prototype,"reset",null),o([R()],t.prototype,"play",null),o([R()],t.prototype,"pause",null),o([R()],t.prototype,"togglePlayback",null),o([R()],t.prototype,"resetPlayback",null),o([R()],t.prototype,"isPaused",null),o([R()],t.prototype,"isEnded",null),o([R()],t.prototype,"syncWithLive",null),o([R()],t.prototype,"seekForward",null),o([R()],t.prototype,"seekBackward",null),o([R()],t.prototype,"setVolume",null),o([R()],t.prototype,"getVolume",null),o([R()],t.prototype,"increaseVolume",null),o([R()],t.prototype,"decreaseVolume",null),o([R()],t.prototype,"mute",null),o([R()],t.prototype,"unmute",null),o([R()],t.prototype,"isMuted",null),o([R()],t.prototype,"setAutoplay",null),o([R()],t.prototype,"getAutoplay",null),o([R()],t.prototype,"setLoop",null),o([R()],t.prototype,"getLoop",null),o([R()],t.prototype,"setPlaybackRate",null),o([R()],t.prototype,"getPlaybackRate",null),o([R()],t.prototype,"setPreload",null),o([R()],t.prototype,"getPreload",null),o([R()],t.prototype,"getCurrentTime",null),o([R()],t.prototype,"seekTo",null),o([R()],t.prototype,"getDuration",null),o([R("getVideoRealWidth")],t.prototype,"getVideoWidth",null),o([R("getVideoRealHeight")],t.prototype,"getVideoHeight",null),o([R()],t.prototype,"setPlaysinline",null),o([R()],t.prototype,"getPlaysinline",null),o([R()],t.prototype,"setCrossOrigin",null),o([R()],t.prototype,"getCrossOrigin",null),o([R("getPlaybackState")],t.prototype,"getCurrentState",null),o([R()],t.prototype,"getDebugInfo",null),t}(),ke=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,xe=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function Se(t,e){void 0===e&&(e=1);var i=function(t){var e=(t=t.replace(ke,function(t,e,i,n){return e+e+i+i+n+n})).match(xe);if(e)return{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)};throw new Error("Playable.js: Color passed to theme should be in HEX format")}(t);return"rgba("+i.r+","+i.g+","+i.b+","+e+")"}function Te(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Ce=new Map;function Ae(t){var e=Te(t);return""+e+function(t){if(Ce.has(t)){var e=Ce.get(t)+1;return Ce.set(t,e),""+e}return Ce.set(t,0),""}(e)}function Ie(t){return Object.keys(t).reduce(function(t,e){var i;return n({},t,((i={})[e]=function(t){return"wix-playable--"+Ae(t)}(e),i))},{})}var Le,Oe=function(){function t(){this._rulesByModule=new Map,this._classNamesByModule=new Map,this._dat