UNPKG

wotnot-video-react

Version:

Video-React is a web video player built from the ground up for an HTML5 world using React library.

1 lines 68.8 kB
(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux")):"function"==typeof define&&define.amd?define(["exports","react","redux"],t):(e=e||self,t(e["video-react"]={},e.React,e.Redux))})(this,function(a,o,i){'use strict';function s(e,t){for(var a,n=0;n<t.length;n++)a=t[n],a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}function u(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),e}function E(){return E=Object.assign||function(e){for(var t,a=1;a<arguments.length;a++)for(var n in t=arguments[a],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},E.apply(this,arguments)}function C(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function T(e,t){if(null==e)return{};var a,n,o={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],0<=t.indexOf(a)||(o[a]=e[a]);return o}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e,t){return t={exports:{}},e(t,t.exports),t.exports}function N(t){if("object"==typeof t&&null!==t){var o=t.$$typeof;switch(o){case b:switch(t=t.type,t){case k:case l:case d:case f:case e:case n:return t;default:switch(t=t&&t.$$typeof,t){case h:case m:case r:case q:case g:return t;default:return o;}}case c:return o;}}}function M(e){return N(e)===l}function A(e){if(null===e||e===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function D(){}function R(){}function F(e,t){switch(void 0===e&&(e=Ye),t.type){case"video-react/USER_ACTIVATE":return E({},e,{userActivity:t.activity});case"video-react/PLAYER_ACTIVATE":return E({},e,{isActive:t.activity});case"video-react/FULLSCREEN_CHANGE":return E({},e,{isFullscreen:!!t.isFullscreen});case"video-react/SEEKING_TIME":return E({},e,{seekingTime:t.time});case"video-react/END_SEEKING":return E({},e,{seekingTime:0});case"video-react/LOAD_START":return E({},e,t.videoProps,{hasStarted:!1,ended:!1});case"video-react/CAN_PLAY":return E({},e,t.videoProps,{waiting:!1});case"video-react/WAITING":return E({},e,t.videoProps,{waiting:!0});case"video-react/CAN_PLAY_THROUGH":case"video-react/PLAYING":return E({},e,t.videoProps,{waiting:!1});case"video-react/PLAY":return E({},e,t.videoProps,{ended:!1,paused:!1,autoPaused:!1,waiting:!1,hasStarted:!0});case"video-react/PAUSE":return E({},e,t.videoProps,{paused:!0});case"video-react/END":return E({},e,t.videoProps,{ended:!0});case"video-react/SEEKING":return E({},e,t.videoProps,{seeking:!0});case"video-react/SEEKED":return E({},e,t.videoProps,{seeking:!1});case"video-react/ERROR":return E({},e,t.videoProps,{error:"UNKNOWN ERROR",ended:!0});case"video-react/DURATION_CHANGE":case"video-react/TIME_UPDATE":case"video-react/VOLUME_CHANGE":case"video-react/PROGRESS_CHANGE":case"video-react/RATE_CHANGE":case"video-react/SUSPEND":case"video-react/ABORT":case"video-react/EMPTIED":case"video-react/STALLED":case"video-react/LOADED_META_DATA":case"video-react/LOADED_DATA":case"video-react/RESIZE":return E({},e,t.videoProps);case"video-react/ACTIVATE_TEXT_TRACK":return E({},e,{activeTextTrack:t.textTrack});default:return e;}}function I(e,t){switch(void 0===e&&(e=$e),t.type){case"video-react/OPERATE":return E({},e,{count:e.count+1,operation:E({},e.operation,t.operation)});default:return e;}}function L(e,t){return void 0===e&&(e={}),{player:F(e.player,t),operation:I(e.operation,t)}}function _(e){var t=e.player,a=e.className;return t.error?null:ne.createElement("div",{className:Ge("video-react-loading-spinner",a)})}function B(e){var t=e.poster,a=e.player,n=e.actions,o=e.className;return!t||a.hasStarted?null:ne.createElement("div",{className:Ge("video-react-poster",o),style:{backgroundImage:"url(\""+t+"\")"},onClick:function(){a.paused&&n.play()}})}function O(e,t){var a=Math.floor;void 0===e&&(e=0),void 0===t&&(t=e);var n=a(e%60),o=a(e/60%60),r=a(e/3600),l=a(t/60%60),d=a(t/3600);return(et(e)||e===1/0)&&(r="-",o="-",n="-"),r=0<r||0<d?r+":":"",o=((r||10<=l)&&10>o?"0"+o:o)+":",n=10>n?"0"+n:n,r+o+n}function U(e){return!!(e.props&&e.props.isVideoChild)||"source"===e.type||"track"===e.type}function j(t,a,n,o){void 0===o&&(o=1);var r=ne.Children.toArray(a),l=n.order,d=T(n,["order"]);return r.filter(function(t){return!t.props.disabled}).concat(t.filter(function(e){return!tt(r,function(t){return at(t,e)})})).map(function(a){var n=tt(t,function(e){return at(e,a)}),o=n?n.props:{},r=E({},d,o,a.props),l=ne.cloneElement(a,r,a.props.children);return l}).sort(function(e,t){return(e.props.order||o)-(t.props.order||o)})}function K(e,t){console.warn("WARNING: "+e+" will be deprecated soon! Please use "+t+" instead.")}function G(e,t){var a=arguments,n=!1;return function(){n||(e.apply(void 0,a),n=!0,setTimeout(function(){n=!1},t))}}function H(e){var a,t=Math.round;if(e.getBoundingClientRect&&e.parentNode&&(a=e.getBoundingClientRect()),!a)return{left:0,top:0};var n=document,o=n.body,r=n.documentElement,l=r.clientLeft||o.clientLeft||0,d=window.pageXOffset||o.scrollLeft,i=a.left+d-l,s=r.clientTop||o.clientTop||0,c=window.pageYOffset||o.scrollTop,p=a.top+c-s;return{left:t(i),top:t(p)}}function V(e,t){var a=Math.max,n=Math.min,o={},r=H(e),l=e.offsetWidth,d=e.offsetHeight,i=r.top,s=r.left,c=t.pageY,p=t.pageX;return t.changedTouches&&(p=t.changedTouches[0].pageX,c=t.changedTouches[0].pageY),o.y=a(0,n(1,(i-c+d)/d)),o.x=a(0,n(1,(p-s)/l)),o}function z(e){e&&e.focus&&e.focus()}function W(e,t){for(var a=e.className.split(" "),n=0;n<a.length;n++)if(a[n].toLowerCase()===t.toLowerCase())return!0;return!1}function Y(e){var t=e.currentTime,a=e.duration,n=e.percentage,o=e.className;return ne.createElement("div",{"data-current-time":O(t,a),className:Ge("video-react-play-progress video-react-slider-bar",o),style:{width:n}},ne.createElement("span",{className:"video-react-control-text"},"Progress: "+n))}function $(e){function t(e,t){var a=e/t||0;return 100*(1<=a?1:a)+"%"}var a=e.buffered,n=e.duration,o=e.className;if(!a||!a.length)return null;var r=a.end(a.length-1),l={};r>n&&(r=n),l.width=t(r,n);for(var d=[],s=0;s<a.length;s++){var c=a.start(s),p=a.end(s),u=ne.createElement("div",{style:{left:t(c,r),width:t(p-c,r)},key:"part-"+s});d.push(u)}return 0===d.length&&(d=null),ne.createElement("div",{style:l,className:Ge("video-react-load-progress",o)},ne.createElement("span",{className:"video-react-control-text"},"Loaded: 0%"),d)}function X(e){var t=e.duration,a=e.mouseTime,n=e.className,o=e.text;if(!a.time)return null;var r=o||O(a.time,t);return ne.createElement("div",{className:Ge("video-react-mouse-display",n),style:{left:a.position+"px"},"data-current-time":r})}function Z(e){var t=e.player,a=t.currentTime,n=t.duration,o=e.className,r=O(n-a);return ne.createElement("div",{className:Ge("video-react-remaining-time video-react-time-control video-react-control",o)},ne.createElement("div",{className:"video-react-remaining-time-display","aria-live":"off"},ne.createElement("span",{className:"video-react-control-text"},"Remaining Time "),"-"+r))}function J(e){var t=e.player,a=t.currentTime,n=t.duration,o=e.className,r=O(a,n);return ne.createElement("div",{className:Ge("video-react-current-time video-react-time-control video-react-control",o)},ne.createElement("div",{className:"video-react-current-time-display","aria-live":"off"},ne.createElement("span",{className:"video-react-control-text"},"Current Time "),r))}function Q(e){var t=e.player.duration,a=e.className,n=O(t);return ne.createElement("div",{className:Ge(a,"video-react-duration video-react-time-control video-react-control")},ne.createElement("div",{className:"video-react-duration-display","aria-live":"off"},ne.createElement("span",{className:"video-react-control-text"},"Duration Time "),n))}function ee(e){var t=e.separator,a=e.className;return ne.createElement("div",{className:Ge("video-react-time-control video-react-time-divider",a),dir:"ltr"},ne.createElement("div",null,ne.createElement("span",null,t||"/")))}function te(e){var t=e.inline,a=e.className,n=E({},e);return delete n.children,delete n.inline,delete n.className,ne.createElement(It,E({className:Ge(a,{"video-react-menu-button-inline":!!t,"video-react-menu-button-popup":!t},"video-react-control video-react-button video-react-menu-button")},n),ne.createElement(Lt,e))}function ae(e){var t=e.percentage,a=e.vertical,n=e.className,o={};return a?o.height=t:o.width=t,ne.createElement("div",{className:Ge(n,"video-react-volume-level"),style:o},ne.createElement("span",{className:"video-react-control-text"}))}var ne="default"in o?o["default"]:o,oe="function"==typeof Symbol&&Symbol.for,b=oe?Symbol.for("react.element"):60103,c=oe?Symbol.for("react.portal"):60106,d=oe?Symbol.for("react.fragment"):60107,e=oe?Symbol.for("react.strict_mode"):60108,f=oe?Symbol.for("react.profiler"):60114,g=oe?Symbol.for("react.provider"):60109,h=oe?Symbol.for("react.context"):60110,k=oe?Symbol.for("react.async_mode"):60111,l=oe?Symbol.for("react.concurrent_mode"):60111,m=oe?Symbol.for("react.forward_ref"):60112,n=oe?Symbol.for("react.suspense"):60113,p=oe?Symbol.for("react.suspense_list"):60120,q=oe?Symbol.for("react.memo"):60115,r=oe?Symbol.for("react.lazy"):60116,t=oe?Symbol.for("react.block"):60121,v=oe?Symbol.for("react.fundamental"):60117,w=oe?Symbol.for("react.responder"):60118,x=oe?Symbol.for("react.scope"):60119,y={AsyncMode:k,ConcurrentMode:l,ContextConsumer:h,ContextProvider:g,Element:b,ForwardRef:m,Fragment:d,Lazy:r,Memo:q,Portal:c,Profiler:f,StrictMode:e,Suspense:n,isAsyncMode:function(e){return M(e)||N(e)===k},isConcurrentMode:M,isContextConsumer:function(e){return N(e)===h},isContextProvider:function(e){return N(e)===g},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===b},isForwardRef:function(e){return N(e)===m},isFragment:function(e){return N(e)===d},isLazy:function(e){return N(e)===r},isMemo:function(e){return N(e)===q},isPortal:function(e){return N(e)===c},isProfiler:function(e){return N(e)===f},isStrictMode:function(t){return N(t)===e},isSuspense:function(e){return N(e)===n},isValidElementType:function(o){return"string"==typeof o||"function"==typeof o||o===d||o===l||o===f||o===e||o===n||o===p||"object"==typeof o&&null!==o&&(o.$$typeof===r||o.$$typeof===q||o.$$typeof===g||o.$$typeof===h||o.$$typeof===m||o.$$typeof===v||o.$$typeof===w||o.$$typeof===x||o.$$typeof===t)},typeOf:N},re=S(function(){}),le=re.AsyncMode,de=re.ConcurrentMode,ie=re.ContextConsumer,se=re.ContextProvider,ce=re.Element,pe=re.ForwardRef,ue=re.Fragment,he=re.Lazy,me=re.Memo,ve=re.Portal,ye=re.Profiler,ge=re.StrictMode,Ee=re.Suspense,be=re.isAsyncMode,fe=re.isConcurrentMode,Ce=re.isContextConsumer,ke=re.isContextProvider,Te=re.isElement,Pe=re.isForwardRef,Se=re.isFragment,Ne=re.isLazy,Ae=re.isMemo,Me=re.isPortal,De=re.isProfiler,we=re.isStrictMode,Re=re.isSuspense,Fe=re.isValidElementType,Ie=re.typeOf,xe=S(function(e){e.exports=y}),Le=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,Oe=function(){var e=String.fromCharCode;try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var a={},n=0;10>n;n++)a["_"+e(n)]=n;var o=Object.getOwnPropertyNames(a).map(function(e){return a[e]});if("0123456789"!==o.join(""))return!1;var r={};return["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"].forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e){for(var t,a,n=A(e),o=1;o<arguments.length;o++){for(var r in t=Object(arguments[o]),t)_e.call(t,r)&&(n[r]=t[r]);if(Le){a=Le(t);for(var l=0;l<a.length;l++)Be.call(t,a[l])&&(n[a[l]]=t[a[l]])}}return n},Ue=Function.call.bind(Object.prototype.hasOwnProperty);R.resetWarningCache=D;var je=function(){function e(e,t,a,n,o,r){if(r!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:R,resetWarningCache:D};return a.PropTypes=a,a},Ke=S(function(e){e.exports=je()}),Ge=S(function(e){(function(){function t(){for(var e,n=[],o=0;o<arguments.length;o++)if(e=arguments[o],e){var r=typeof e;if("string"===r||"number"===r)n.push(e);else if(Array.isArray(e)&&e.length){var l=t.apply(null,e);l&&n.push(l)}else if("object"===r)for(var d in e)a.call(e,d)&&e[d]&&n.push(d)}return n.join(" ")}var a={}.hasOwnProperty;e.exports?(t.default=t,e.exports=t):window.classNames=t})()}),He=Object.freeze({__proto__:null,LOAD_START:"video-react/LOAD_START",CAN_PLAY:"video-react/CAN_PLAY",WAITING:"video-react/WAITING",CAN_PLAY_THROUGH:"video-react/CAN_PLAY_THROUGH",PLAYING:"video-react/PLAYING",PLAY:"video-react/PLAY",PAUSE:"video-react/PAUSE",END:"video-react/END",SEEKING:"video-react/SEEKING",SEEKED:"video-react/SEEKED",SEEKING_TIME:"video-react/SEEKING_TIME",END_SEEKING:"video-react/END_SEEKING",DURATION_CHANGE:"video-react/DURATION_CHANGE",TIME_UPDATE:"video-react/TIME_UPDATE",VOLUME_CHANGE:"video-react/VOLUME_CHANGE",PROGRESS_CHANGE:"video-react/PROGRESS_CHANGE",RATE_CHANGE:"video-react/RATE_CHANGE",SUSPEND:"video-react/SUSPEND",ABORT:"video-react/ABORT",EMPTIED:"video-react/EMPTIED",STALLED:"video-react/STALLED",LOADED_META_DATA:"video-react/LOADED_META_DATA",LOADED_DATA:"video-react/LOADED_DATA",RESIZE:"video-react/RESIZE",ERROR:"video-react/ERROR",ACTIVATE_TEXT_TRACK:"video-react/ACTIVATE_TEXT_TRACK",handleLoadStart:function(e){return{type:"video-react/LOAD_START",videoProps:e}},handleCanPlay:function(e){return{type:"video-react/CAN_PLAY",videoProps:e}},handleWaiting:function(e){return{type:"video-react/WAITING",videoProps:e}},handleCanPlayThrough:function(e){return{type:"video-react/CAN_PLAY_THROUGH",videoProps:e}},handlePlaying:function(e){return{type:"video-react/PLAYING",videoProps:e}},handlePlay:function(e){return{type:"video-react/PLAY",videoProps:e}},handlePause:function(e){return{type:"video-react/PAUSE",videoProps:e}},handleEnd:function(e){return{type:"video-react/END",videoProps:e}},handleSeeking:function(e){return{type:"video-react/SEEKING",videoProps:e}},handleSeeked:function(e){return{type:"video-react/SEEKED",videoProps:e}},handleDurationChange:function(e){return{type:"video-react/DURATION_CHANGE",videoProps:e}},handleTimeUpdate:function(e){return{type:"video-react/TIME_UPDATE",videoProps:e}},handleVolumeChange:function(e){return{type:"video-react/VOLUME_CHANGE",videoProps:e}},handleProgressChange:function(e){return{type:"video-react/PROGRESS_CHANGE",videoProps:e}},handleRateChange:function(e){return{type:"video-react/RATE_CHANGE",videoProps:e}},handleSuspend:function(e){return{type:"video-react/SUSPEND",videoProps:e}},handleAbort:function(e){return{type:"video-react/ABORT",videoProps:e}},handleEmptied:function(e){return{type:"video-react/EMPTIED",videoProps:e}},handleStalled:function(e){return{type:"video-react/STALLED",videoProps:e}},handleLoadedMetaData:function(e){return{type:"video-react/LOADED_META_DATA",videoProps:e}},handleLoadedData:function(e){return{type:"video-react/LOADED_DATA",videoProps:e}},handleResize:function(e){return{type:"video-react/RESIZE",videoProps:e}},handleError:function(e){return{type:"video-react/ERROR",videoProps:e}},handleSeekingTime:function(e){return{type:"video-react/SEEKING_TIME",time:e}},handleEndSeeking:function(e){return{type:"video-react/END_SEEKING",time:e}},activateTextTrack:function(e){return{type:"video-react/ACTIVATE_TEXT_TRACK",textTrack:e}}}),Ve=function(){function e(){}var t=e.prototype;return t.request=function(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},t.exit=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},t.addEventListener=function(e,t){t.addEventListener("fullscreenchange",e),t.addEventListener("webkitfullscreenchange",e),t.addEventListener("mozfullscreenchange",e),t.addEventListener("MSFullscreenChange",e)},t.removeEventListener=function(e,t){t.removeEventListener("fullscreenchange",e),t.removeEventListener("webkitfullscreenchange",e),t.removeEventListener("mozfullscreenchange",e),t.removeEventListener("MSFullscreenChange",e)},u(e,[{key:"isFullscreen",get:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}},{key:"enabled",get:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}}]),e}(),ze=new Ve,We=Object.freeze({__proto__:null,OPERATE:"video-react/OPERATE",FULLSCREEN_CHANGE:"video-react/FULLSCREEN_CHANGE",PLAYER_ACTIVATE:"video-react/PLAYER_ACTIVATE",USER_ACTIVATE:"video-react/USER_ACTIVATE",handleFullscreenChange:function(e){return{type:"video-react/FULLSCREEN_CHANGE",isFullscreen:e}},activate:function(e){return{type:"video-react/PLAYER_ACTIVATE",activity:e}},userActivate:function(e){return{type:"video-react/USER_ACTIVATE",activity:e}},play:function(e){return void 0===e&&(e={action:"play",source:""}),this.video.play(),{type:"video-react/OPERATE",operation:e}},pause:function(e){return void 0===e&&(e={action:"pause",source:""}),this.video.pause(),{type:"video-react/OPERATE",operation:e}},togglePlay:function(e){return void 0===e&&(e={action:"toggle-play",source:""}),this.video.togglePlay(),{type:"video-react/OPERATE",operation:e}},seek:function(e,t){return void 0===t&&(t={action:"seek",source:""}),this.video.seek(e),{type:"video-react/OPERATE",operation:t}},forward:function(e,t){return void 0===t&&(t={action:"forward-"+e,source:""}),this.video.forward(e),{type:"video-react/OPERATE",operation:t}},replay:function(e,t){return void 0===t&&(t={action:"replay-"+e,source:""}),this.video.replay(e),{type:"video-react/OPERATE",operation:t}},changeRate:function(e,t){return void 0===t&&(t={action:"change-rate",source:""}),this.video.playbackRate=e,{type:"video-react/OPERATE",operation:t}},changeVolume:function(e,t){void 0===t&&(t={action:"change-volume",source:""});var a=e;return 0>e&&(a=0),1<e&&(a=1),this.video.volume=a,{type:"video-react/OPERATE",operation:t}},mute:function(e,t){return void 0===t&&(t={action:e?"muted":"unmuted",source:""}),this.video.muted=e,{type:"video-react/OPERATE",operation:t}},toggleFullscreen:function(e){return ze.enabled?(ze.isFullscreen?ze.exit():ze.request(this.rootElement),{type:"video-react/OPERATE",operation:{action:"toggle-fullscreen",source:""}}):{type:"video-react/FULLSCREEN_CHANGE",isFullscreen:!e.isFullscreen}}}),Ye={currentSrc:null,duration:0,currentTime:0,seekingTime:0,buffered:null,waiting:!1,seeking:!1,paused:!0,autoPaused:!1,ended:!1,playbackRate:1,muted:!1,volume:1,readyState:0,networkState:0,videoWidth:0,videoHeight:0,hasStarted:!1,userActivity:!0,isActive:!1,isFullscreen:!1,activeTextTrack:null},$e={count:0,operation:{action:"",source:""}},qe=function(){function e(e){this.store=e||i.createStore(L),this.video=null,this.rootElement=null}var t=e.prototype;return t.getActions=function(){function e(e){return function(){var n=e.apply(t,arguments);"undefined"!=typeof n&&a(n)}}var t=this,a=this.store.dispatch,n=E({},We,He);return Object.keys(n).filter(function(e){return"function"==typeof n[e]}).reduce(function(t,a){return t[a]=e(n[a]),t},{})},t.getState=function(){return this.store.getState()},t.subscribeToStateChange=function(e,t){t||(t=this.getState.bind(this));var a=t(),n=function(){var n=t();if(n!==a){var o=a;a=n,e(n,o)}};return this.store.subscribe(n)},t.subscribeToOperationStateChange=function(e){var t=this;return this.subscribeToStateChange(e,function(){return t.getState().operation})},t.subscribeToPlayerStateChange=function(e){var t=this;return this.subscribeToStateChange(e,function(){return t.getState().player})},e}(),Xe={actions:Ke.object,player:Ke.object,position:Ke.string,className:Ke.string},Ze=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleClick=n.handleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.componentDidMount=function(){},a.handleClick=function(){var e=this.props.actions;e.play()},a.render=function(){var e=this.props,t=e.player,a=e.position;return ne.createElement("button",{className:Ge("video-react-button","video-react-big-play-button","video-react-big-play-button-"+a,this.props.className,{"big-play-button-hide":t.hasStarted||!t.currentSrc}),type:"button","aria-live":"polite",tabIndex:"0",onClick:this.handleClick},ne.createElement("span",{className:"video-react-control-text"},"Play Video"))},t}(o.Component);Ze.propTypes=Xe,Ze.defaultProps={position:"left"},Ze.displayName="BigPlayButton";var Je={player:Ke.object,className:Ke.string};_.propTypes=Je,_.displayName="LoadingSpinner";var Qe={poster:Ke.string,player:Ke.object,actions:Ke.object,className:Ke.string};B.propTypes=Qe,B.displayName="PosterImage";var et=Number.isNaN||function(e){return e!==e},tt=function(e,t){return e.filter(t)[0]},at=function(e,t){var a=e.type,n=t.type;return"string"==typeof a||"string"==typeof n?a===n:!("function"!=typeof a||"function"!=typeof n)&&a.displayName===n.displayName},nt=["error","src","srcObject","currentSrc","crossOrigin","networkState","preload","buffered","readyState","seeking","currentTime","duration","paused","defaultPlaybackRate","playbackRate","played","seekable","ended","autoplay","loop","mediaGroup","controller","controls","volume","muted","defaultMuted","audioTracks","videoTracks","textTracks","width","height","videoWidth","videoHeight","poster"],ot={actions:Ke.object,player:Ke.object,children:Ke.any,startTime:Ke.number,loop:Ke.bool,muted:Ke.bool,autoPlay:Ke.bool,playsInline:Ke.bool,src:Ke.string,poster:Ke.string,className:Ke.string,preload:Ke.oneOf(["auto","metadata","none"]),crossOrigin:Ke.string,onLoadStart:Ke.func,onWaiting:Ke.func,onCanPlay:Ke.func,onCanPlayThrough:Ke.func,onPlaying:Ke.func,onEnded:Ke.func,onSeeking:Ke.func,onSeeked:Ke.func,onPlay:Ke.func,onPause:Ke.func,onProgress:Ke.func,onDurationChange:Ke.func,onError:Ke.func,onSuspend:Ke.func,onAbort:Ke.func,onEmptied:Ke.func,onStalled:Ke.func,onLoadedMetadata:Ke.func,onLoadedData:Ke.func,onTimeUpdate:Ke.func,onRateChange:Ke.func,onVolumeChange:Ke.func,onResize:Ke.func},rt=function(e){function t(t){var a;return a=e.call(this,t)||this,a.video=null,a.play=a.play.bind(P(a)),a.pause=a.pause.bind(P(a)),a.seek=a.seek.bind(P(a)),a.forward=a.forward.bind(P(a)),a.replay=a.replay.bind(P(a)),a.toggleFullscreen=a.toggleFullscreen.bind(P(a)),a.getProperties=a.getProperties.bind(P(a)),a.renderChildren=a.renderChildren.bind(P(a)),a.handleLoadStart=a.handleLoadStart.bind(P(a)),a.handleCanPlay=a.handleCanPlay.bind(P(a)),a.handleCanPlayThrough=a.handleCanPlayThrough.bind(P(a)),a.handlePlay=a.handlePlay.bind(P(a)),a.handlePlaying=a.handlePlaying.bind(P(a)),a.handlePause=a.handlePause.bind(P(a)),a.handleEnded=a.handleEnded.bind(P(a)),a.handleWaiting=a.handleWaiting.bind(P(a)),a.handleSeeking=a.handleSeeking.bind(P(a)),a.handleSeeked=a.handleSeeked.bind(P(a)),a.handleFullscreenChange=a.handleFullscreenChange.bind(P(a)),a.handleError=a.handleError.bind(P(a)),a.handleSuspend=a.handleSuspend.bind(P(a)),a.handleAbort=a.handleAbort.bind(P(a)),a.handleEmptied=a.handleEmptied.bind(P(a)),a.handleStalled=a.handleStalled.bind(P(a)),a.handleLoadedMetaData=a.handleLoadedMetaData.bind(P(a)),a.handleLoadedData=a.handleLoadedData.bind(P(a)),a.handleTimeUpdate=a.handleTimeUpdate.bind(P(a)),a.handleRateChange=a.handleRateChange.bind(P(a)),a.handleVolumeChange=a.handleVolumeChange.bind(P(a)),a.handleDurationChange=a.handleDurationChange.bind(P(a)),a.handleProgress=G(a.handleProgress.bind(P(a)),250),a.handleKeypress=a.handleKeypress.bind(P(a)),a.handleTextTrackChange=a.handleTextTrackChange.bind(P(a)),a}C(t,e);var a=t.prototype;return a.componentDidMount=function(){this.forceUpdate(),this.video&&this.video.textTracks&&(this.video.textTracks.onaddtrack=this.handleTextTrackChange,this.video.textTracks.onremovetrack=this.handleTextTrackChange)},a.getProperties=function(){var e=this;return this.video?nt.reduce(function(t,a){return t[a]=e.video[a],t},{}):null},a.handleTextTrackChange=function(){var e=this.props,t=e.actions,a=e.player;if(this.video&&this.video.textTracks){var n=Array.from(this.video.textTracks).find(function(e){return"showing"===e.mode});n!==a.activeTextTrack&&t.activateTextTrack(n)}},a.play=function(){var e=this.video.play();void 0!==e&&e.catch(function(){}).then(function(){})},a.pause=function(){var e=this.video.pause();void 0!==e&&e.catch(function(){}).then(function(){})},a.load=function(){this.video.load()},a.addTextTrack=function(){var e;(e=this.video).addTextTrack.apply(e,arguments)},a.canPlayType=function(){var e;(e=this.video).canPlayType.apply(e,arguments)},a.togglePlay=function(){this.video.paused?this.play():this.pause()},a.seek=function(e){try{this.video.currentTime=e}catch(t){}},a.forward=function(e){this.seek(this.video.currentTime+e)},a.replay=function(e){this.forward(-e)},a.toggleFullscreen=function(){var e=this.props,t=e.player,a=e.actions;a.toggleFullscreen(t)},a.handleLoadStart=function(){var e=this.props,t=e.actions,a=e.onLoadStart;t.handleLoadStart(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleCanPlay=function(){var e=this.props,t=e.actions,a=e.onCanPlay;t.handleCanPlay(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleCanPlayThrough=function(){var e=this.props,t=e.actions,a=e.onCanPlayThrough;t.handleCanPlayThrough(this.getProperties()),a&&a.apply(void 0,arguments)},a.handlePlaying=function(){var e=this.props,t=e.actions,a=e.onPlaying;t.handlePlaying(this.getProperties()),a&&a.apply(void 0,arguments)},a.handlePlay=function(){var e=this.props,t=e.actions,a=e.onPlay;t.handlePlay(this.getProperties()),a&&a.apply(void 0,arguments)},a.handlePause=function(){var e=this.props,t=e.actions,a=e.onPause;t.handlePause(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleDurationChange=function(){var e=this.props,t=e.actions,a=e.onDurationChange;t.handleDurationChange(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleProgress=function(){var e=this.props,t=e.actions,a=e.onProgress;this.video&&t.handleProgressChange(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleEnded=function(){var e=this.props,t=e.loop,a=e.player,n=e.actions,o=e.onEnded;t?(this.seek(0),this.play()):!a.paused&&this.pause(),n.handleEnd(this.getProperties()),o&&o.apply(void 0,arguments)},a.handleWaiting=function(){var e=this.props,t=e.actions,a=e.onWaiting;t.handleWaiting(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleSeeking=function(){var e=this.props,t=e.actions,a=e.onSeeking;t.handleSeeking(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleSeeked=function(){var e=this.props,t=e.actions,a=e.onSeeked;t.handleSeeked(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleFullscreenChange=function(){},a.handleSuspend=function(){var e=this.props,t=e.actions,a=e.onSuspend;t.handleSuspend(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleAbort=function(){var e=this.props,t=e.actions,a=e.onAbort;t.handleAbort(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleEmptied=function(){var e=this.props,t=e.actions,a=e.onEmptied;t.handleEmptied(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleStalled=function(){var e=this.props,t=e.actions,a=e.onStalled;t.handleStalled(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleLoadedMetaData=function(){var e=this.props,t=e.actions,a=e.onLoadedMetadata,n=e.startTime;n&&0<n&&(this.video.currentTime=n),t.handleLoadedMetaData(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleLoadedData=function(){var e=this.props,t=e.actions,a=e.onLoadedData;t.handleLoadedData(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleTimeUpdate=function(){var e=this.props,t=e.actions,a=e.onTimeUpdate;t.handleTimeUpdate(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleRateChange=function(){var e=this.props,t=e.actions,a=e.onRateChange;t.handleRateChange(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleVolumeChange=function(){var e=this.props,t=e.actions,a=e.onVolumeChange;t.handleVolumeChange(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleError=function(){var e=this.props,t=e.actions,a=e.onError;t.handleError(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleResize=function(){var e=this.props,t=e.actions,a=e.onResize;t.handleResize(this.getProperties()),a&&a.apply(void 0,arguments)},a.handleKeypress=function(){},a.renderChildren=function(){var e=this,t=E({},this.props,{video:this.video});return this.video?ne.Children.toArray(this.props.children).filter(U).map(function(a){var n;if("string"!=typeof a.type)n=t;else if("source"===a.type){n=E({},a.props);var o=n.onError;n.onError=function(){o&&o.apply(void 0,arguments),e.handleError.apply(e,arguments)}}return ne.cloneElement(a,n)}):null},a.render=function(){var e=this,t=this.props,a=t.loop,n=t.poster,o=t.preload,r=t.src,l=t.autoPlay,d=t.playsInline,i=t.muted,s=t.crossOrigin,c=t.videoId;return ne.createElement("video",{className:Ge("video-react-video",this.props.className),id:c,crossOrigin:s,ref:function(t){e.video=t},muted:i,preload:o,loop:a,playsInline:d,autoPlay:l,poster:n,src:r,onLoadStart:this.handleLoadStart,onWaiting:this.handleWaiting,onCanPlay:this.handleCanPlay,onCanPlayThrough:this.handleCanPlayThrough,onPlaying:this.handlePlaying,onEnded:this.handleEnded,onSeeking:this.handleSeeking,onSeeked:this.handleSeeked,onPlay:this.handlePlay,onPause:this.handlePause,onProgress:this.handleProgress,onDurationChange:this.handleDurationChange,onError:this.handleError,onSuspend:this.handleSuspend,onAbort:this.handleAbort,onEmptied:this.handleEmptied,onStalled:this.handleStalled,onLoadedMetadata:this.handleLoadedMetaData,onLoadedData:this.handleLoadedData,onTimeUpdate:this.handleTimeUpdate,onRateChange:this.handleRateChange,onVolumeChange:this.handleVolumeChange,tabIndex:"-1"},this.renderChildren())},u(t,[{key:"playbackRate",get:function(){return this.video.playbackRate},set:function(e){this.video.playbackRate=e}},{key:"muted",get:function(){return this.video.muted},set:function(e){this.video.muted=e}},{key:"volume",get:function(){return this.video.volume},set:function(e){1<e&&(e=1),0>e&&(e=0),this.video.volume=e}},{key:"videoWidth",get:function(){return this.video.videoWidth}},{key:"videoHeight",get:function(){return this.video.videoHeight}}]),t}(o.Component);rt.propTypes=ot,rt.displayName="Video";var lt={manager:Ke.object,className:Ke.string},dt=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.timer=null,t.manager.subscribeToOperationStateChange(n.handleStateChange.bind(P(n))),n.state={hidden:!0,operation:{}},n}C(t,e);var a=t.prototype;return a.handleStateChange=function(e,t){var a=this;e.count!==t.count&&"shortcut"===e.operation.source&&(this.timer&&(clearTimeout(this.timer),this.timer=null),this.setState({hidden:!1,count:e.count,operation:e.operation}),this.timer=setTimeout(function(){a.setState({hidden:!0}),a.timer=null},500))},a.render=function(){if("shortcut"!==this.state.operation.source)return null;var e=this.state.hidden?{display:"none"}:null;return ne.createElement("div",{className:Ge({"video-react-bezel":!0,"video-react-bezel-animation":0==this.state.count%2,"video-react-bezel-animation-alt":1==this.state.count%2},this.props.className),style:e,role:"status","aria-label":this.state.operation.action},ne.createElement("div",{className:Ge("video-react-bezel-icon","video-react-bezel-icon-"+this.state.operation.action)}))},t}(o.Component);dt.propTypes=lt,dt.displayName="Bezel";var it={clickable:Ke.bool,dblclickable:Ke.bool,manager:Ke.object,actions:Ke.object,player:Ke.object,shortcuts:Ke.array,document:Ke.objectOf(Ke.object),handleFullscreenFun:Ke.func},st={clickable:!0,dblclickable:!0,document:window.document,handleFullscreenFun:void 0},ct=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.defaultShortcuts=[{keyCode:32,handle:n.togglePlay},{keyCode:75,handle:n.togglePlay},{keyCode:70,handle:n.toggleFullscreen},{keyCode:37,handle:function(e,t){e.hasStarted&&t.replay(5,{action:"replay-5",source:"shortcut"})}},{keyCode:74,handle:function(e,t){e.hasStarted&&t.replay(10,{action:"replay-10",source:"shortcut"})}},{keyCode:39,handle:function(e,t){e.hasStarted&&t.forward(5,{action:"forward-5",source:"shortcut"})}},{keyCode:76,handle:function(e,t){e.hasStarted&&t.forward(10,{action:"forward-10",source:"shortcut"})}},{keyCode:36,handle:function(e,t){e.hasStarted&&t.seek(0)}},{keyCode:35,handle:function(e,t){e.hasStarted&&t.seek(e.duration)}},{keyCode:38,handle:function(e,t){var a=e.volume+.05;1<a&&(a=1),t.changeVolume(a,{action:"volume-up",source:"shortcut"})}},{keyCode:40,handle:function(e,t){var a=e.volume-.05;0>a&&(a=0);var n=0<a?"volume-down":"volume-off";t.changeVolume(a,{action:n,source:"shortcut"})}},{keyCode:190,shift:!0,handle:function(e,t){var a=e.playbackRate;1.5<=a?a=2:1.25<=a?a=1.5:1<=a?a=1.25:.5<=a?a=1:.25<=a?a=.5:0<=a&&(a=.25),t.changeRate(a,{action:"fast-forward",source:"shortcut"})}},{keyCode:188,shift:!0,handle:function(e,t){var a=e.playbackRate;.5>=a?a=.25:1>=a?a=.5:1.25>=a?a=1:1.5>=a?a=1.25:2>=a&&(a=1.5),t.changeRate(a,{action:"fast-rewind",source:"shortcut"})}}],n.shortcuts=[].concat(n.defaultShortcuts),n.mergeShortcuts=n.mergeShortcuts.bind(P(n)),n.handleKeyPress=n.handleKeyPress.bind(P(n)),n.handleClick=n.handleClick.bind(P(n)),n.handleDoubleClick=n.handleDoubleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.componentDidMount=function(){this.mergeShortcuts();var e=this.props.document;e.addEventListener("keydown",this.handleKeyPress),e.addEventListener("click",this.handleClick),e.addEventListener("dblclick",this.handleDoubleClick)},a.componentDidUpdate=function(e){e.shortcuts!==this.props.shortcuts&&this.mergeShortcuts()},a.componentWillUnmount=function(){var e=this.props.document;e.removeEventListener("keydown",this.handleKeyPress),e.removeEventListener("click",this.handleClick),e.removeEventListener("dblclick",this.handleDoubleClick)},a.mergeShortcuts=function(){var e=function(e){var t=e.keyCode,a=void 0===t?0:t,n=e.ctrl,o=e.shift,r=e.alt;return a+":"+(void 0!==n&&n)+":"+(void 0!==o&&o)+":"+(void 0!==r&&r)},t=this.defaultShortcuts.reduce(function(t,a){var n;return Object.assign(t,(n={},n[e(a)]=a,n))},{}),a=(this.props.shortcuts||[]).reduce(function(t,a){var n=a.keyCode,o=a.handle;if(n&&"function"==typeof o){var r;return Object.assign(t,(r={},r[e(a)]=a,r))}return t},t),n=function(e){var t=0;return["ctrl","shift","alt"].forEach(function(a){e[a]&&t++}),t};this.shortcuts=Object.keys(a).map(function(e){return a[e]}).sort(function(e,t){return n(t)-n(e)})},a.togglePlay=function(e,t){e.paused?t.play({action:"play",source:"shortcut"}):t.pause({action:"pause",source:"shortcut"})},a.toggleFullscreen=function(e,t){var a=this.props.document;t.toggleFullscreen(e,a)},a.handleKeyPress=function(t){var e=this.props,a=e.player,n=e.actions;if(a.isActive){var o=this.props.document;if(!(o.activeElement&&(W(o.activeElement,"video-react-control")||W(o.activeElement,"video-react-menu-button-active")||W(o.activeElement,"video-react-big-play-button")))){var r=t.keyCode||t.which,l=t.ctrlKey||t.metaKey,d=t.shiftKey,i=t.altKey,s=this.shortcuts.filter(function(e){return!!(e.keyCode&&0==e.keyCode-r)&&(void 0===e.ctrl||e.ctrl===l)&&(void 0===e.shift||e.shift===d)&&(void 0===e.alt||e.alt===i)})[0];s&&(s.handle(a,n),t.preventDefault())}}},a.canBeClicked=function(t,a){return!!(t.isActive&&"VIDEO"===a.target.nodeName&&4===t.readyState)},a.handleClick=function(t){var e=this.props,a=e.player,n=e.actions,o=e.clickable;this.canBeClicked(a,t)&&o&&this.togglePlay(a,n)},a.handleDoubleClick=function(t){var e=this.props,a=e.player,n=e.actions,o=e.dblclickable,r=e.document,l=e.disabledFullscreen,d=e.handleFullscreenFun;this.canBeClicked(a,t)&&o&&!l&&(d?d(a,n,r):this.toggleFullscreen(a,n,r))},a.render=function(){return null},t}(o.Component);ct.propTypes=it,ct.defaultProps=st,ct.displayName="Shortcut";var pt={className:Ke.string,onMouseDown:Ke.func,onMouseMove:Ke.func,stepForward:Ke.func,stepBack:Ke.func,sliderActive:Ke.func,sliderInactive:Ke.func,onMouseUp:Ke.func,onFocus:Ke.func,onBlur:Ke.func,onClick:Ke.func,getPercent:Ke.func,vertical:Ke.bool,children:Ke.node,label:Ke.string,valuenow:Ke.string,valuetext:Ke.string,document:Ke.object},ut=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleMouseDown=n.handleMouseDown.bind(P(n)),n.handleMouseMove=n.handleMouseMove.bind(P(n)),n.handleMouseUp=n.handleMouseUp.bind(P(n)),n.handleFocus=n.handleFocus.bind(P(n)),n.handleBlur=n.handleBlur.bind(P(n)),n.handleClick=n.handleClick.bind(P(n)),n.handleKeyPress=n.handleKeyPress.bind(P(n)),n.stepForward=n.stepForward.bind(P(n)),n.stepBack=n.stepBack.bind(P(n)),n.calculateDistance=n.calculateDistance.bind(P(n)),n.getProgress=n.getProgress.bind(P(n)),n.renderChildren=n.renderChildren.bind(P(n)),n.state={active:!1},n}C(t,e);var a=t.prototype;return a.componentWillUnmount=function(){var e=this.props.document;e.removeEventListener("mousemove",this.handleMouseMove,!0),e.removeEventListener("mouseup",this.handleMouseUp,!0),e.removeEventListener("touchmove",this.handleMouseMove,!0),e.removeEventListener("touchend",this.handleMouseUp,!0),e.removeEventListener("keydown",this.handleKeyPress,!0)},a.getProgress=function(){var e=this.props.getPercent;if(!e)return 0;var t=e();return("number"!=typeof t||0>t||t===1/0)&&(t=0),t},a.handleMouseDown=function(e){var t=this.props.onMouseDown,a=this.props.document;a.addEventListener("mousemove",this.handleMouseMove,!0),a.addEventListener("mouseup",this.handleMouseUp,!0),a.addEventListener("touchmove",this.handleMouseMove,!0),a.addEventListener("touchend",this.handleMouseUp,!0),this.setState({active:!0}),this.props.sliderActive&&this.props.sliderActive(e),this.handleMouseMove(e),t&&t(e)},a.handleMouseMove=function(e){var t=this.props.onMouseMove;t&&t(e)},a.handleMouseUp=function(e){e.preventDefault();var t=this.props.onMouseUp,a=this.props.document;a.removeEventListener("mousemove",this.handleMouseMove,!0),a.removeEventListener("mouseup",this.handleMouseUp,!0),a.removeEventListener("touchmove",this.handleMouseMove,!0),a.removeEventListener("touchend",this.handleMouseUp,!0),this.setState({active:!1}),this.props.sliderInactive&&this.props.sliderInactive(e),t&&t(e)},a.handleFocus=function(t){var e=this.props.document;e.addEventListener("keydown",this.handleKeyPress,!0),this.props.onFocus&&this.props.onFocus(t)},a.handleBlur=function(t){var e=this.props.document;e.removeEventListener("keydown",this.handleKeyPress,!0),this.props.onBlur&&this.props.onBlur(t)},a.handleClick=function(e){e.preventDefault(),this.props.onClick&&this.props.onClick(e)},a.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),e.stopPropagation(),this.stepBack()):(38===e.which||39===e.which)&&(e.preventDefault(),e.stopPropagation(),this.stepForward())},a.stepForward=function(){this.props.stepForward&&this.props.stepForward()},a.stepBack=function(){this.props.stepBack&&this.props.stepBack()},a.calculateDistance=function(e){var t=this.slider,a=V(t,e);return this.props.vertical?a.y:a.x},a.renderChildren=function(){var e=this.getProgress(),t=(100*e).toFixed(2)+"%";return ne.Children.map(this.props.children,function(a){return ne.cloneElement(a,{progress:e,percentage:t})})},a.render=function(){var e=this,t=this.props,a=t.vertical,n=t.label,o=t.valuenow,r=t.valuetext;return ne.createElement("div",{className:Ge(this.props.className,{"video-react-slider-vertical":a,"video-react-slider-horizontal":!a,"video-react-sliding":this.state.active},"video-react-slider"),ref:function(t){e.slider=t},tabIndex:"0",role:"slider",onMouseDown:this.handleMouseDown,onTouchStart:this.handleMouseDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleClick,"aria-label":n||"","aria-valuenow":o||"","aria-valuetext":r||"","aria-valuemin":0,"aria-valuemax":100},this.renderChildren())},t}(o.Component);ut.propTypes=pt,ut.displayName="Slider",ut.defaultProps={document:window.document};var ht={currentTime:Ke.number,duration:Ke.number,percentage:Ke.string,className:Ke.string};Y.propTypes=ht,Y.displayName="PlayProgressBar";var mt={duration:Ke.number,buffered:Ke.object,className:Ke.string};$.propTypes=mt,$.displayName="LoadProgressBar",X.propTypes={duration:Ke.number,mouseTime:Ke.object,className:Ke.string},X.displayName="MouseTimeDisplay";var vt={player:Ke.object,mouseTime:Ke.object,actions:Ke.object,className:Ke.string},yt=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.getPercent=n.getPercent.bind(P(n)),n.getNewTime=n.getNewTime.bind(P(n)),n.stepForward=n.stepForward.bind(P(n)),n.stepBack=n.stepBack.bind(P(n)),n.handleMouseDown=n.handleMouseDown.bind(P(n)),n.handleMouseMove=n.handleMouseMove.bind(P(n)),n.handleMouseUp=n.handleMouseUp.bind(P(n)),n}C(t,e);var a=t.prototype;return a.componentDidMount=function(){},a.componentDidUpdate=function(){},a.getPercent=function(){var e=this.props.player,t=e.currentTime,a=e.seekingTime,n=e.duration,o=(a||t)/n;return 1<=o?1:o},a.getNewTime=function(e){var t=this.props.player.duration,a=this.slider.calculateDistance(e),n=a*t;return n===t?n-.1:n},a.handleMouseDown=function(){},a.handleMouseUp=function(e){var t=this.props.actions,a=this.getNewTime(e);t.seek(a),t.handleEndSeeking(a)},a.handleMouseMove=function(e){var t=this.props.actions,a=this.getNewTime(e);t.handleSeekingTime(a)},a.stepForward=function(){var e=this.props.actions;e.forward(5)},a.stepBack=function(){var e=this.props.actions;e.replay(5)},a.render=function(){var e=this,t=this.props,a=t.player,n=a.currentTime,o=a.seekingTime,r=a.duration,l=a.buffered,d=t.mouseTime,i=t.document,s=o||n;return ne.createElement(ut,{ref:function(t){e.slider=t},label:"video progress bar",className:Ge("video-react-progress-holder",this.props.className),valuenow:(100*this.getPercent()).toFixed(2),valuetext:O(s,r),onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,getPercent:this.getPercent,stepForward:this.stepForward,stepBack:this.stepBack,document:i},ne.createElement($,{buffered:l,currentTime:s,duration:r}),ne.createElement(X,{duration:r,mouseTime:d}),ne.createElement(Y,{currentTime:s,duration:r}))},t}(o.Component);yt.propTypes=vt,yt.displayName="SeekBar";var gt={player:Ke.object,className:Ke.string},Et=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.state={mouseTime:{time:null,position:0}},n.handleMouseMoveThrottle=n.handleMouseMove.bind(P(n)),n}C(t,e);var a=t.prototype;return a.handleMouseMove=function(e){if(e.pageX){var t=this.props.player.duration,a=this.seekBar,n=V(a,e).x*t,o=e.pageX-H(a).left;this.setState({mouseTime:{time:n,position:o}})}},a.render=function(){var e=this,t=this.props.className;return ne.createElement("div",{onMouseMove:this.handleMouseMoveThrottle,className:Ge("video-react-progress-control video-react-control",t)},ne.createElement(yt,E({mouseTime:this.state.mouseTime,ref:function(t){e.seekBar=t}},this.props)))},t}(o.Component);Et.propTypes=gt,Et.displayName="ProgressControl";var bt={actions:Ke.object,player:Ke.object,className:Ke.string},ft=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleClick=n.handleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.handleClick=function(){var e=this.props,t=e.actions,a=e.player;a.paused?t.play():t.pause()},a.render=function(){var e=this,t=this.props,a=t.player,n=t.className,o=a.paused?"Play":"Pause";return ne.createElement("button",{ref:function(t){e.button=t},className:Ge(n,{"video-react-play-control":!0,"video-react-control":!0,"video-react-button":!0,"video-react-paused":a.paused,"video-react-playing":!a.paused}),type:"button",tabIndex:"0",onClick:this.handleClick},ne.createElement("span",{className:"video-react-control-text"},o))},t}(o.Component);ft.propTypes=bt,ft.displayName="PlayToggle";var Ct={actions:Ke.object,className:Ke.string,seconds:Ke.oneOf([5,10,30])},kt={seconds:10},Tt=function(e){var t=function(t){function a(e,a){var n;return n=t.call(this,e,a)||this,n.handleClick=n.handleClick.bind(P(n)),n}C(a,t);var n=a.prototype;return n.handleClick=function(){var t=this.props,a=t.actions,n=t.seconds;"forward"===e?a.forward(n):a.replay(n)},n.render=function(){var t=this,a=this.props,n=a.seconds,o=a.className,r=["video-react-control","video-react-button","video-react-icon"];return r.push("video-react-icon-"+e+"-"+n,"video-react-"+e+"-control"),o&&r.push(o),ne.createElement("button",{ref:function(e){t.button=e},className:r.join(" "),type:"button",onClick:this.handleClick},ne.createElement("span",{className:"video-react-control-text"},e+" "+n+" seconds"))},a}(o.Component);return t.propTypes=Ct,t.defaultProps=kt,t},Pt=Tt("forward");Pt.displayName="ForwardControl";var St=Tt("replay");St.displayName="ReplayControl";var Nt={actions:Ke.object,player:Ke.object,className:Ke.string},At=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleClick=n.handleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.handleClick=function(){var e=this.props,t=e.player,a=e.actions;a.toggleFullscreen(t)},a.render=function(){var e=this,t=this.props,a=t.player,n=t.className;return ne.createElement("button",{className:Ge(n,{"video-react-icon-fullscreen-exit":a.isFullscreen,"video-react-icon-fullscreen":!a.isFullscreen},"video-react-fullscreen-control video-react-control video-react-button video-react-icon"),ref:function(t){e.button=t},type:"button",tabIndex:"0",onClick:this.handleClick},ne.createElement("span",{className:"video-react-control-text"},"Non-Fullscreen"))},t}(o.Component);At.propTypes=Nt,At.displayName="FullscreenToggle";var Mt={player:Ke.object,className:Ke.string};Z.propTypes=Mt,Z.displayName="RemainingTimeDisplay";var Dt={player:Ke.object,className:Ke.string};J.propTypes=Dt,J.displayName="CurrentTimeDisplay";var wt={player:Ke.object,className:Ke.string};Q.propTypes=wt,Q.displayName="DurationDisplay";var Rt={separator:Ke.string,className:Ke.string};ee.propTypes=Rt,ee.displayName="TimeDivider";var Ft={tagName:Ke.string,onClick:Ke.func.isRequired,onFocus:Ke.func,onBlur:Ke.func,className:Ke.string},It=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleClick=n.handleClick.bind(P(n)),n.handleFocus=n.handleFocus.bind(P(n)),n.handleBlur=n.handleBlur.bind(P(n)),n.handleKeypress=n.handleKeypress.bind(P(n)),n}C(t,e);var a=t.prototype;return a.componentWillUnmount=function(t){this.handleBlur(t)},a.handleKeypress=function(e){(32===e.which||13===e.which)&&(e.preventDefault(),this.handleClick(e))},a.handleClick=function(e){var t=this.props.onClick;t(e)},a.handleFocus=function(t){document.addEventListener("keydown",this.handleKeypress),this.props.onFocus&&this.props.onFocus(t)},a.handleBlur=function(t){document.removeEventListener("keydown",this.handleKeypress),this.props.onBlur&&this.props.onBlur(t)},a.render=function(){var e=this.props.tagName,t=E({},this.props);return delete t.tagName,delete t.className,ne.createElement(e,E({className:Ge(this.props.className),role:"button",tabIndex:"0",onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur},t))},t}(o.Component);It.propTypes=Ft,It.defaultProps={tagName:"div"},It.displayName="ClickableComponent";var xt={player:Ke.object,children:Ke.any},Lt=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.handleClick=n.handleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.handleClick=function(e){e.preventDefault()},a.render=function(){var e=this.props.children;return ne.createElement("div",{className:"video-react-menu",onClick:this.handleClick},ne.createElement("div",{className:"video-react-menu-content"},e))},t}(o.Component);Lt.propTypes=xt,Lt.displayName="Popup";var _t={inline:Ke.bool,onClick:Ke.func.isRequired,onFocus:Ke.func,onBlur:Ke.func,className:Ke.string};te.propTypes=_t,te.defaultProps={inline:!0},te.displayName="PopupButton";var Bt={percentage:Ke.string,vertical:Ke.bool,className:Ke.string};ae.propTypes=Bt,ae.defaultProps={percentage:"100%",vertical:!1},ae.displayName="VolumeLevel";var Ot={actions:Ke.object,player:Ke.object,className:Ke.string,onFocus:Ke.func,onBlur:Ke.func},Ut=function(e){function t(t,a){var n;return n=e.call(this,t,a)||this,n.state={percentage:"0%"},n.handleMouseMove=n.handleMouseMove.bind(P(n)),n.handlePercentageChange=n.handlePercentageChange.bind(P(n)),n.checkMuted=n.checkMuted.bind(P(n)),n.getPercent=n.getPercent.bind(P(n)),n.stepForward=n.stepForward.bind(P(n)),n.stepBack=n.stepBack.bind(P(n)),n.handleFocus=n.handleFocus.bind(P(n)),n.handleBlur=n.handleBlur.bind(P(n)),n.handleClick=n.handleClick.bind(P(n)),n}C(t,e);var a=t.prototype;return a.componentDidMount=function(){},a.getPercent=function(){var e=this.props.player;return e.muted?0:e.volume},a.checkMuted=function(){var e=this.props,t=e.player,a=e.actions;t.muted&&a.mute(!1)},a.handleMouseMove=function(e){var t=this.props.actions;this.checkMuted();var a=this.slider.calculateDistance(e);t.changeVolume(a)},a.stepForward=function(){var e=this.props,t=e.player,a=e.actions;this.checkMuted(),a.changeVolume(t.volume+.1)},a.stepBack=function(){var e=this.props,t=e.player,a=e.actions;this.checkMuted(),a.changeVolume(t.volume-.1)},a.handleFocus=function(t){this.props.onFocus&&this.props.onFocus(t)},a.handleBlur=function(t){this.props.onBlur&&this.props.onBlur(t)},a.handlePercentageChange=function(e){e!==this.state.percentage&&this.setState({percentage:e})},a.handleClick=function(e){e.s