@halibegic/react-video-player 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/live-player/live-player-event-check.d.ts +4 -3
- package/dist/components/live-player/live-player-event-listener.d.ts +3 -0
- package/dist/components/live-player/live-player-tech.d.ts +4 -1
- package/dist/components/live-player/ui/live-player-gestures.d.ts +2 -0
- package/dist/components/player/player-event-listener.d.ts +1 -0
- package/dist/components/player/player-hls-engine.d.ts +4 -1
- package/dist/components/player/player-tech.d.ts +4 -1
- package/dist/components/player/ui/player-gestures.d.ts +9 -0
- package/dist/components/player/ui/player-menu.d.ts +8 -0
- package/dist/components/vod-player/ui/vod-player-gestures.d.ts +2 -0
- package/dist/components/vod-player/vod-player-event-listener.d.ts +3 -0
- package/dist/react-video-player.es.js +1257 -1030
- package/dist/react-video-player.es.js.map +1 -1
- package/dist/react-video-player.umd.js +10 -10
- package/dist/react-video-player.umd.js.map +1 -1
- package/dist/stores/player-store.d.ts +10 -1
- package/dist/style.css +1 -1
- package/dist/types/player.d.ts +16 -15
- package/dist/utils/device.d.ts +2 -1
- package/package.json +3 -2
- package/dist/components/live-player/ui/live-player-desktop-playback-indicator.d.ts +0 -2
- package/dist/components/player/ui/player-controls.styles.d.ts +0 -16
- package/dist/components/player/ui/player-desktop-playback-indicator.d.ts +0 -4
- package/dist/components/player/ui/player-dropdown.d.ts +0 -7
- package/dist/components/player/ui/player-notice.styles.d.ts +0 -6
- package/dist/components/player/ui/player-progress.styles.d.ts +0 -8
- package/dist/components/player/ui/player-remaining-time.styles.d.ts +0 -6
- package/dist/components/vod-player/ui/vod-player-desktop-playback-indicator.d.ts +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(R,
|
|
2
|
-
`+Ue+r}}var
|
|
3
|
-
`),
|
|
4
|
-
`),
|
|
5
|
-
`+
|
|
1
|
+
(function(R,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("react"),require("zustand"),require("mitt"),require("hls.js"),require("@radix-ui/react-slider"),require("@radix-ui/react-popover"),require("@radix-ui/react-scroll-area")):typeof define=="function"&&define.amd?define(["exports","react","zustand","mitt","hls.js","@radix-ui/react-slider","@radix-ui/react-popover","@radix-ui/react-scroll-area"],f):(R=typeof globalThis!="undefined"?globalThis:R||self,f(R.ReactVideoPlayer={},R.React,R.zustand,R.Mitt,R.Hls,R.RadixUISlider,R.RadixUIPopover,R.RadixUIScrollArea))})(this,(function(R,f,U,ee,te,tn,nn,rn){"use strict";var oo=Object.defineProperty,io=Object.defineProperties;var ao=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var $t=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var qt=(R,f,U)=>f in R?oo(R,f,{enumerable:!0,configurable:!0,writable:!0,value:U}):R[f]=U,L=(R,f)=>{for(var U in f||(f={}))$t.call(f,U)&&qt(R,U,f[U]);if(Fe)for(var U of Fe(f))en.call(f,U)&&qt(R,U,f[U]);return R},pe=(R,f)=>io(R,ao(f));var re=(R,f)=>{var U={};for(var ee in R)$t.call(R,ee)&&f.indexOf(ee)<0&&(U[ee]=R[ee]);if(R!=null&&Fe)for(var ee of Fe(R))f.indexOf(ee)<0&&en.call(R,ee)&&(U[ee]=R[ee]);return U};function Ne(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _e=Ne(tn),ve=Ne(nn),xe=Ne(rn);function Ge(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function Je(e){var t=this;return new t(function(n,o){if(!(e&&typeof e.length!="undefined"))return o(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var s=Array.prototype.slice.call(e);if(s.length===0)return n([]);var c=s.length;function u(l,d){if(d&&(typeof d=="object"||typeof d=="function")){var w=d.then;if(typeof w=="function"){w.call(d,function(g){u(l,g)},function(g){s[l]={status:"rejected",reason:g},--c===0&&n(s)});return}}s[l]={status:"fulfilled",value:d},--c===0&&n(s)}for(var i=0;i<s.length;i++)u(i,s[i])})}function Qe(e,t){this.name="AggregateError",this.errors=e,this.message=t||""}Qe.prototype=Error.prototype;function qe(e){var t=this;return new t(function(n,o){if(!(e&&typeof e.length!="undefined"))return o(new TypeError("Promise.any accepts an array"));var s=Array.prototype.slice.call(e);if(s.length===0)return o();for(var c=[],u=0;u<s.length;u++)try{t.resolve(s[u]).then(n).catch(function(i){c.push(i),c.length===s.length&&o(new Qe(c,"All promises were rejected"))})}catch(i){o(i)}})}var on=setTimeout;function $e(e){return!!(e&&typeof e.length!="undefined")}function an(){}function sn(e,t){return function(){e.apply(t,arguments)}}function N(e){if(!(this instanceof N))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],tt(e,this)}function et(e,t){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(t);return}e._handled=!0,N._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n===null){(e._state===1?Ve:ye)(t.promise,e._value);return}var o;try{o=n(e._value)}catch(s){ye(t.promise,s);return}Ve(t.promise,o)})}function Ve(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var n=t.then;if(t instanceof N){e._state=3,e._value=t,Ae(e);return}else if(typeof n=="function"){tt(sn(n,t),e);return}}e._state=1,e._value=t,Ae(e)}catch(o){ye(e,o)}}function ye(e,t){e._state=2,e._value=t,Ae(e)}function Ae(e){e._state===2&&e._deferreds.length===0&&N._immediateFn(function(){e._handled||N._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)et(e,e._deferreds[t]);e._deferreds=null}function ln(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function tt(e,t){var n=!1;try{e(function(o){n||(n=!0,Ve(t,o))},function(o){n||(n=!0,ye(t,o))})}catch(o){if(n)return;n=!0,ye(t,o)}}N.prototype.catch=function(e){return this.then(null,e)},N.prototype.then=function(e,t){var n=new this.constructor(an);return et(this,new ln(e,t,n)),n},N.prototype.finally=Ge,N.all=function(e){return new N(function(t,n){if(!$e(e))return n(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(e);if(o.length===0)return t([]);var s=o.length;function c(i,l){try{if(l&&(typeof l=="object"||typeof l=="function")){var d=l.then;if(typeof d=="function"){d.call(l,function(w){c(i,w)},n);return}}o[i]=l,--s===0&&t(o)}catch(w){n(w)}}for(var u=0;u<o.length;u++)c(u,o[u])})},N.any=qe,N.allSettled=Je,N.resolve=function(e){return e&&typeof e=="object"&&e.constructor===N?e:new N(function(t){t(e)})},N.reject=function(e){return new N(function(t,n){n(e)})},N.race=function(e){return new N(function(t,n){if(!$e(e))return n(new TypeError("Promise.race accepts an array"));for(var o=0,s=e.length;o<s;o++)N.resolve(e[o]).then(t,n)})},N._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){on(e,0)},N._unhandledRejectionFn=function(t){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var se=(function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")})();typeof se.Promise!="function"?se.Promise=N:(se.Promise.prototype.finally||(se.Promise.prototype.finally=Ge),se.Promise.allSettled||(se.Promise.allSettled=Je),se.Promise.any||(se.Promise.any=qe));var Re={exports:{}},ge={};var nt;function cn(){if(nt)return ge;nt=1;var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(i,l,d){var w,g={},y=null,E=null;d!==void 0&&(y=""+d),l.key!==void 0&&(y=""+l.key),l.ref!==void 0&&(E=l.ref);for(w in l)o.call(l,w)&&!c.hasOwnProperty(w)&&(g[w]=l[w]);if(i&&i.defaultProps)for(w in l=i.defaultProps,l)g[w]===void 0&&(g[w]=l[w]);return{$$typeof:t,type:i,key:y,ref:E,props:g,_owner:s.current}}return ge.Fragment=n,ge.jsx=u,ge.jsxs=u,ge}var we={};var rt;function un(){return rt||(rt=1,process.env.NODE_ENV!=="production"&&(function(){var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator,P="@@iterator";function k(r){if(r===null||typeof r!="object")return null;var m=I&&r[I]||r[P];return typeof m=="function"?m:null}var V=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(r){{for(var m=arguments.length,p=new Array(m>1?m-1:0),C=1;C<m;C++)p[C-1]=arguments[C];D("error",r,p)}}function D(r,m,p){{var C=V.ReactDebugCurrentFrame,S=C.getStackAddendum();S!==""&&(m+="%s",p=p.concat([S]));var j=p.map(function(x){return String(x)});j.unshift("Warning: "+m),Function.prototype.apply.call(console[r],console,j)}}var T=!1,M=!1,v=!1,z=!1,Q=!1,Y;Y=Symbol.for("react.module.reference");function A(r){return!!(typeof r=="string"||typeof r=="function"||r===o||r===c||Q||r===s||r===d||r===w||z||r===E||T||M||v||typeof r=="object"&&r!==null&&(r.$$typeof===y||r.$$typeof===g||r.$$typeof===u||r.$$typeof===i||r.$$typeof===l||r.$$typeof===Y||r.getModuleId!==void 0))}function F(r,m,p){var C=r.displayName;if(C)return C;var S=m.displayName||m.name||"";return S!==""?p+"("+S+")":p}function q(r){return r.displayName||"Context"}function X(r){if(r==null)return null;if(typeof r.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case o:return"Fragment";case n:return"Portal";case c:return"Profiler";case s:return"StrictMode";case d:return"Suspense";case w:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case i:var m=r;return q(m)+".Consumer";case u:var p=r;return q(p._context)+".Provider";case l:return F(r,r.render,"ForwardRef");case g:var C=r.displayName||null;return C!==null?C:X(r.type)||"Memo";case y:{var S=r,j=S._payload,x=S._init;try{return X(x(j))}catch(_){return null}}}return null}var W=Object.assign,ie=0,fe,ne,Z,Te,Dt,Mt,Ft;function Nt(){}Nt.__reactDisabledLog=!0;function Lr(){{if(ie===0){fe=console.log,ne=console.info,Z=console.warn,Te=console.error,Dt=console.group,Mt=console.groupCollapsed,Ft=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Nt,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}ie++}}function Ir(){{if(ie--,ie===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},r,{value:fe}),info:W({},r,{value:ne}),warn:W({},r,{value:Z}),error:W({},r,{value:Te}),group:W({},r,{value:Dt}),groupCollapsed:W({},r,{value:Mt}),groupEnd:W({},r,{value:Ft})})}ie<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Be=V.ReactCurrentDispatcher,Ue;function Le(r,m,p){{if(Ue===void 0)try{throw Error()}catch(S){var C=S.stack.trim().match(/\n( *(at )?)/);Ue=C&&C[1]||""}return`
|
|
2
|
+
`+Ue+r}}var ze=!1,Ie;{var Dr=typeof WeakMap=="function"?WeakMap:Map;Ie=new Dr}function Vt(r,m){if(!r||ze)return"";{var p=Ie.get(r);if(p!==void 0)return p}var C;ze=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=Be.current,Be.current=null,Lr();try{if(m){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(J){C=J}Reflect.construct(r,[],x)}else{try{x.call()}catch(J){C=J}r.call(x.prototype)}}else{try{throw Error()}catch(J){C=J}r()}}catch(J){if(J&&C&&typeof J.stack=="string"){for(var _=J.stack.split(`
|
|
3
|
+
`),G=C.stack.split(`
|
|
4
|
+
`),O=_.length-1,B=G.length-1;O>=1&&B>=0&&_[O]!==G[B];)B--;for(;O>=1&&B>=0;O--,B--)if(_[O]!==G[B]){if(O!==1||B!==1)do if(O--,B--,B<0||_[O]!==G[B]){var $=`
|
|
5
|
+
`+_[O].replace(" at new "," at ");return r.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",r.displayName)),typeof r=="function"&&Ie.set(r,$),$}while(O>=1&&B>=0);break}}}finally{ze=!1,Be.current=j,Ir(),Error.prepareStackTrace=S}var me=r?r.displayName||r.name:"",ce=me?Le(me):"";return typeof r=="function"&&Ie.set(r,ce),ce}function Mr(r,m,p){return Vt(r,!1)}function Fr(r){var m=r.prototype;return!!(m&&m.isReactComponent)}function De(r,m,p){if(r==null)return"";if(typeof r=="function")return Vt(r,Fr(r));if(typeof r=="string")return Le(r);switch(r){case d:return Le("Suspense");case w:return Le("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case l:return Mr(r.render);case g:return De(r.type,m,p);case y:{var C=r,S=C._payload,j=C._init;try{return De(j(S),m,p)}catch(x){}}}return""}var Ee=Object.prototype.hasOwnProperty,At={},Ot=V.ReactDebugCurrentFrame;function Me(r){if(r){var m=r._owner,p=De(r.type,r._source,m?m.type:null);Ot.setExtraStackFrame(p)}else Ot.setExtraStackFrame(null)}function Nr(r,m,p,C,S){{var j=Function.call.bind(Ee);for(var x in r)if(j(r,x)){var _=void 0;try{if(typeof r[x]!="function"){var G=Error((C||"React class")+": "+p+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw G.name="Invariant Violation",G}_=r[x](m,x,C,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){_=O}_&&!(_ instanceof Error)&&(Me(S),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",p,x,typeof _),Me(null)),_ instanceof Error&&!(_.message in At)&&(At[_.message]=!0,Me(S),b("Failed %s type: %s",p,_.message),Me(null))}}}var Vr=Array.isArray;function We(r){return Vr(r)}function Ar(r){{var m=typeof Symbol=="function"&&Symbol.toStringTag,p=m&&r[Symbol.toStringTag]||r.constructor.name||"Object";return p}}function Or(r){try{return Ht(r),!1}catch(m){return!0}}function Ht(r){return""+r}function Bt(r){if(Or(r))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ar(r)),Ht(r)}var Ut=V.ReactCurrentOwner,Hr={key:!0,ref:!0,__self:!0,__source:!0},zt,Wt;function Br(r){if(Ee.call(r,"ref")){var m=Object.getOwnPropertyDescriptor(r,"ref").get;if(m&&m.isReactWarning)return!1}return r.ref!==void 0}function Ur(r){if(Ee.call(r,"key")){var m=Object.getOwnPropertyDescriptor(r,"key").get;if(m&&m.isReactWarning)return!1}return r.key!==void 0}function zr(r,m){typeof r.ref=="string"&&Ut.current}function Wr(r,m){{var p=function(){zt||(zt=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};p.isReactWarning=!0,Object.defineProperty(r,"key",{get:p,configurable:!0})}}function Zr(r,m){{var p=function(){Wt||(Wt=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};p.isReactWarning=!0,Object.defineProperty(r,"ref",{get:p,configurable:!0})}}var Kr=function(r,m,p,C,S,j,x){var _={$$typeof:t,type:r,key:m,ref:p,props:x,_owner:j};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function Yr(r,m,p,C,S){{var j,x={},_=null,G=null;p!==void 0&&(Bt(p),_=""+p),Ur(m)&&(Bt(m.key),_=""+m.key),Br(m)&&(G=m.ref,zr(m,S));for(j in m)Ee.call(m,j)&&!Hr.hasOwnProperty(j)&&(x[j]=m[j]);if(r&&r.defaultProps){var O=r.defaultProps;for(j in O)x[j]===void 0&&(x[j]=O[j])}if(_||G){var B=typeof r=="function"?r.displayName||r.name||"Unknown":r;_&&Wr(x,B),G&&Zr(x,B)}return Kr(r,_,G,S,C,Ut.current,x)}}var Ze=V.ReactCurrentOwner,Zt=V.ReactDebugCurrentFrame;function he(r){if(r){var m=r._owner,p=De(r.type,r._source,m?m.type:null);Zt.setExtraStackFrame(p)}else Zt.setExtraStackFrame(null)}var Ke;Ke=!1;function Ye(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function Kt(){{if(Ze.current){var r=X(Ze.current.type);if(r)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+r+"`."}return""}}function
|
|
7
|
+
Check the render method of \``+r+"`."}return""}}function Xr(r){return""}var Yt={};function Gr(r){{var m=Kt();if(!m){var p=typeof r=="string"?r:r.displayName||r.name;p&&(m=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+p+">.")}return
|
|
9
|
+
Check the top-level render call using <`+p+">.")}return m}}function Xt(r,m){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var p=Gr(m);if(Yt[p])return;Yt[p]=!0;var C="";r&&r._owner&&r._owner!==Ze.current&&(C=" It was passed a child from "+X(r._owner.type)+"."),he(r),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,C),he(null)}}function Gt(r,m){{if(typeof r!="object")return;if(We(r))for(var p=0;p<r.length;p++){var C=r[p];Ye(C)&&Xt(C,m)}else if(Ye(r))r._store&&(r._store.validated=!0);else if(r){var S=k(r);if(typeof S=="function"&&S!==r.entries)for(var j=S.call(r),x;!(x=j.next()).done;)Ye(x.value)&&Xt(x.value,m)}}}function Jr(r){{var m=r.type;if(m==null||typeof m=="string")return;var p;if(typeof m=="function")p=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===l||m.$$typeof===g))p=m.propTypes;else return;if(p){var C=X(m);Nr(p,r.props,"prop",C,r)}else if(m.PropTypes!==void 0&&!Ke){Ke=!0;var S=X(m);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Qr(r){{for(var m=Object.keys(r.props),p=0;p<m.length;p++){var C=m[p];if(C!=="children"&&C!=="key"){he(r),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),he(null);break}}r.ref!==null&&(he(r),b("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var Jt={};function Qt(r,m,p,C,S,j){{var x=A(r);if(!x){var _="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var G=Xr();G?_+=G:_+=Kt();var O;r===null?O="null":We(r)?O="array":r!==void 0&&r.$$typeof===t?(O="<"+(X(r.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):O=typeof r,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,_)}var B=Yr(r,m,p,S,j);if(B==null)return B;if(x){var $=m.children;if($!==void 0)if(C)if(We($)){for(var me=0;me<$.length;me++)Gt($[me],r);Object.freeze&&Object.freeze($)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Gt($,r)}if(Ee.call(m,"key")){var ce=X(r),J=Object.keys(m).filter(function(ro){return ro!=="key"}),Xe=J.length>0?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}";if(!Jt[ce+Xe]){var no=J.length>0?"{"+J.join(": ..., ")+": ...}":"{}";b(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,
|
|
15
|
-
`);for(const n of t){const
|
|
16
|
-
`);let s=!1;for(const i of n){const l=i.trim();if(l.startsWith("#EXT-X-STREAM-INF:")){s=!0;continue}if(s&&!l.startsWith("#")){if(l.startsWith("http"))return l;{const u=new URL(t);return new URL(l,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function Yn(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function Kn(e){try{const t=Yn(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const s=await n.text(),i=Zn(s,t);if(!i)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",i);const l=await fetch(i);if(!l.ok)throw new Error(`Failed to fetch chunklist: ${l.status} ${l.statusText}`);const u=await l.text(),o=zn(u);return o?console.log("Successfully detected start time:",o.toISOString()):console.log(" No start time found in chunklist"),o}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function Xn(n){var s=n,{url:e}=s,t=q(s,["url"]);const[i,l]=d.useState(!0),u=A(m=>m.startDate),o=A(m=>m.setStartDate),c=d.useCallback(async()=>{const m=await Kn(e);m&&o(m)},[e,o]);return d.useEffect(()=>{(async()=>{l(!0),await c(),l(!1)})()},[c]),Ve(c,u?null:5e3),i?null:a.jsx(Jn,D({},t))}function Jn({children:e,eventNotStartedMessage:t="Event has not started yet.",eventStartingSoonMessage:n="Starting in few seconds..."}){const s=A(o=>o.startDate),i=h(o=>o.isStarted);return Tn(i?null:5e3),s?Date.now()<s.getTime()?a.jsx(Gn,{startDate:s,title:t,message:n}):a.jsx(a.Fragment,{children:e}):a.jsx("div",{className:Ee,children:a.jsx("h3",{className:xe,children:t})})}function Gn({startDate:e,title:t,message:n}){const s=e.getTime()-Date.now(),i=Math.floor(s/(1e3*60*60)),l=Math.floor(s%(1e3*60*60)/(1e3*60));return i||l?a.jsxs("div",{className:Ee,children:[a.jsx("h3",{className:xe,children:t}),a.jsxs("p",{className:Ne,children:["(",i>0?`${i}h ${l}m`:`${l}m`,")"]})]}):a.jsx("div",{className:Ee,children:a.jsx("h3",{className:xe,children:n})})}function ct(){const e=h(o=>o.exitFullscreen),t=h(o=>o.isFullscreen),n=h(o=>o.isFullscreenReady),s=h(o=>o.requestFullscreen),i=h(o=>o.setVolume),l=h(o=>o.volume),u=d.useCallback(o=>{let c=!1;if(!(o.target instanceof HTMLInputElement||o.ctrlKey)){switch(o.code){case"ArrowUp":i(l+10<100?l+10:100),c=!0;break;case"ArrowDown":i(l-10>0?l-10:0),c=!0;break;case"KeyM":i(l===0?100:0),c=!0;break;case"KeyF":n&&(t?e():s(),c=!0);break}c&&o.preventDefault()}},[e,t,n,s,i,l]);return d.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function Qn(){const e=A(o=>o.delay),t=h(o=>o.isPlaying),n=h(o=>o.pause),s=h(o=>o.getPauseTimeDiff),i=h(o=>o.play),l=A(o=>o.setDelay),u=d.useCallback(o=>{let c=!1;if(!(o.target instanceof HTMLInputElement||o.ctrlKey)){switch(o.code){case"ArrowLeft":l(e+10),c=!0;break;case"ArrowRight":l(e-10>0?e-10:0),c=!0;break;case"Space":if(t)n();else{const m=s();m&&l(e+m),i()}c=!0;break}c&&o.preventDefault()}},[e,s,t,n,i,l]);return d.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),a.jsx(ct,{})}function ut({children:e}){return a.jsx(Wn,{children:e})}function qn({children:e}){return a.jsx(Rn,{children:a.jsx(ut,{children:e})})}const dt=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),$n=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),er=(e,t)=>Math.max(0,(t-e)/1e3),tr=(e,t=0)=>{const s=t<0?0:t,i=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(s))}${i[l]}`};function nr({isAuto:e,level:t,levels:n}){const s=n.length,i=[];return s>1&&i.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(l,u){const o=l.height||l.bitrate||0,c=u.height||u.bitrate||0;return o===c?0:o>c?1:-1}),n.map(l=>{const{bitrate:u,height:o,index:c}=l;i.push({sid:`quality-level-${c}`,label:o?`${o}p`:tr(u),value:c,selected:s===1||!e&&c===t})}),i}function rr({url:e,isLive:t}){const n=d.useRef(null),s=h(C=>C.level),i=h(C=>C.levels),l=h(C=>C.setLevel),u=h(C=>C.setLevels),o=h(C=>C.techRef),c=h(C=>C.setError),m=d.useRef(0),v=d.useRef(null),w=50,b=1e4,_=d.useCallback(C=>{if(n.current&&(n.current.nextLevel=C,l(null),i)){const I=i.map(y=>ge(D({},y),{selected:y.value===C}));u(I)}},[i,l,u,n]),L=d.useCallback(()=>{n.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),n.current.loadSource(e))},[e]),O=d.useCallback(()=>{if(!n.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),c(null),v.current&&(clearTimeout(v.current),v.current=null),m.current=0;const C=n.current.levels,I=n.current.currentLevel,y=n.current.autoLevelEnabled;u(nr({levels:C.map((X,ne)=>{const{bitrate:re,height:G,width:W}=X;return{bitrate:re,height:G,index:ne,width:W}}),level:I,isAuto:y}))},[c,u]),x=d.useCallback((C,I)=>{if(console.error("[Player][HLS] ERROR",C,I),!!n.current)switch(I.type){case K.ErrorTypes.NETWORK_ERROR:console.log("[Player][HLS] NETWORK_ERROR",I),t?I.details==="manifestLoadError"&&(m.current<w&&(v.current&&clearTimeout(v.current),m.current+=1,v.current=setTimeout(()=>{if(n.current)try{console.log("[Player][HLS] Retrying stream..."),n.current.loadSource(e)}catch(y){console.error("[Player][HLS] Retry failed:",y)}},b)),c({message:"Live event will be back shortly.",code:"MANIFEST_LOAD_ERROR",tech:"hls"})):n.current.startLoad();break;case K.ErrorTypes.MEDIA_ERROR:n.current.recoverMediaError();break}},[t,e,c]),H=d.useCallback(()=>{if(!o.current)return;const C={backBufferLength:10,startLevel:-1,maxBufferSize:30*1024*1024},I={backBufferLength:60,startLevel:-1,maxBufferSize:30*1024*1024},y=t?C:I;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(y)),console.log("[Player][HLS] Version",K.version),n.current=new K(y),n.current.attachMedia(o.current),n.current.on(K.Events.MEDIA_ATTACHED,L),n.current.on(K.Events.MANIFEST_LOADED,O),n.current.on(K.Events.ERROR,x)}catch(X){throw new Error(`Error initializing Hls: ${X}`)}},[O,L,x,t,o,e]),j=d.useCallback(()=>{n.current&&(n.current.off(K.Events.MEDIA_ATTACHED,L),n.current.off(K.Events.MANIFEST_LOADED,O),n.current.off(K.Events.ERROR,x),n.current.destroy(),n.current=null),v.current&&(clearTimeout(v.current),v.current=null),m.current=0},[O,L,x]);return d.useEffect(()=>{s!==null&&_(s)},[s,_]),d.useEffect(()=>(K.isSupported()&&H(),j),[j,H]),null}const or={video:"_video_14rmx_1"};function ft({url:e,isLive:t,isMuted:n=!1}){const s=h(y=>y.handleDurationChange),i=h(y=>y.handleEnd),l=h(y=>y.handleLoadedMetadata),u=h(y=>y.handleLoadStart),o=h(y=>y.handlePause),c=h(y=>y.handlePlay),m=h(y=>y.handlePlaying),v=h(y=>y.handleSeeked),w=h(y=>y.handleSeeking),b=h(y=>y.handleTimeUpdate),_=h(y=>y.handleWaiting),L=h(y=>y.handleVolumeChange),O=h(y=>y.handleError),x=h(y=>y.techRef),H=d.useRef(null),j=()=>t?{}:{onDurationChange:s,onSeeked:v,onSeeking:w,onTimeUpdate:C},C=()=>{(!H.current||Date.now()-H.current>=1e3)&&(b(),H.current=Date.now())},I=j();return a.jsxs(a.Fragment,{children:[a.jsx(rr,{isLive:t,url:e}),a.jsx("video",D({ref:x,className:or.video,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:i,onError:O,onLoadedMetadata:l,onLoadStart:u,onPause:o,onPlay:c,onPlaying:m,onWaiting:_,onVolumeChange:L,tabIndex:-1},I))]})}function sr({url:e}){const[t,n]=d.useState(null),s=A(l=>l.delay),i=d.useCallback(async()=>{n(s?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${s}.m3u8`):e)},[s,e]);return d.useEffect(()=>{i()},[i]),t?a.jsx(ft,{url:t,isLive:!0}):null}const ir={toggleButton:"_toggleButton_m3he7_1"};function ht(s){var i=s,{className:e,onClick:t}=i,n=q(i,["className","onClick"]);const l=d.useRef(null),u=h(_=>_.exitFullscreen),o=h(_=>_.isFullscreen),c=h(_=>_.requestFullscreen),m=_=>{b()?(w(),o?u():c()):v(_)},v=_=>{l.current=window.setTimeout(()=>{t==null||t(_),w()},200)},w=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},b=()=>l.current!==null;return d.useEffect(()=>()=>{w()},[]),a.jsx("button",D({onClick:m,className:[ir.toggleButton,e].filter(Boolean).join(" "),"aria-label":"Player playback indicator"},n))}function ar(){const e=h(o=>o.isPlaying),t=h(o=>o.pause),n=h(o=>o.getPauseTimeDiff),s=h(o=>o.play),i=A(o=>o.delay),l=A(o=>o.setDelay),u=()=>{if(e)t();else{const o=n();o&&l(i+o),s()}};return a.jsx(ht,{onClick:u})}const mt={button:"_button_e9zrb_1",buttonCircle:"_buttonCircle_e9zrb_43"},ee=d.forwardRef((i,s)=>{var l=i,{shape:e="circle",className:t}=l,n=q(l,["shape","className"]);const u=e==="circle"?mt.buttonCircle:"",o=[mt.button,u,t].filter(Boolean).join(" ");return a.jsx("button",D({ref:s,className:o},n))});ee.displayName="PlayerButton";const _e={liveIndicator:"_liveIndicator_1k5fh_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1k5fh_8",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1k5fh_12"};function lr(n){var s=n,{message:e}=s,t=q(s,["message"]);const i=A(c=>c.delay),l=A(c=>c.setDelay),u=()=>{i&&l(0)},o=i?`${_e.liveIndicator} ${_e.liveIndicatorHasDelay}`:`${_e.liveIndicator} ${_e.liveIndicatorNoDelay}`;return a.jsxs(ee,ge(D({onClick:u,shape:"square"},t),{children:[a.jsx("div",{className:o}),e||"Live"]}))}function pt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function vt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function cr(){const e=h(o=>o.isPlaying),t=h(o=>o.pause),n=h(o=>o.getPauseTimeDiff),s=h(o=>o.play),i=A(o=>o.delay),l=A(o=>o.setDelay),u=()=>{if(e)t();else{const o=n();o&&l(i+o),s()}};return a.jsx(ee,{onClick:u,children:e?a.jsx(pt,{}):a.jsx(vt,{})})}const fe={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},yt=fe.progressSlider,gt=fe.tipContainer,Ct=fe.tipContainerVisible,wt=fe.tipContainerHidden,Et=fe.tipContent,Re={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Se=d.forwardRef((l,i)=>{var u=l,{max:e=100,min:t=0,className:n}=u,s=q(u,["max","min","className"]);return a.jsxs(Ce.Root,ge(D({ref:i,min:t,max:e,"aria-label":"Player progress",className:[Re.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:o=>o.preventDefault()},s),{children:[a.jsx(Ce.Track,{className:Re.sliderTrack,children:a.jsx(Ce.Range,{className:Re.sliderRange})}),a.jsx(Ce.Thumb,{className:Re.sliderThumb})]}))});Se.displayName="PlayerSlider";function Pe(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const xt="vod-player-progress-bar";function ur(){const e=d.useRef(null),t=d.useRef(null),[n,s]=d.useState(0),[i,l]=d.useState(0),[u,o]=d.useState(!1),[c,m]=d.useState(-1),[v,w]=d.useState(-1),b=A(M=>M.delay),_=A(M=>M.startDate),L=_?_.getTime():0,O=new Date().getTime(),x=A(M=>M.setDelay),H=h(M=>M.isPlaying),j=h(M=>M.addIdleLock),C=h(M=>M.removeIdleLock),I=d.useCallback(()=>{s($n(L,b)),l(er(L,O))},[b,O,L]),y=parseFloat((i?(v!==-1?v:n)/i*100:0).toFixed(1)),X=M=>{w(i*(M[0]/100)),j(xt)},ne=()=>{if(v!==-1){const M=dt(L,v);x(M),w(-1),C(xt)}},re=()=>o(!0),G=()=>o(!1),W=d.useCallback(M=>{const he=e.current,z=t.current;if(he&&z){const J=Pe(he),oe=Pe(z),me=(M.pageX||M.clientX)-J.left,pe=me/J.width;if(pe<0)return;let Q=me-oe.width/2;Q<0&&(Q=0),Q>J.width-oe.width&&(Q=-1),z.style.left=Q>-1?`${Q}px`:"auto",z.style.right=Q>-1?"auto":"0px";const ve=i-pe*i;m(ve>0?ve:0)}re()},[i]);return Ve(()=>I(),H?1e3:null),d.useEffect(()=>{I()},[I]),a.jsxs("div",{className:yt,children:[a.jsx(Se,{ref:e,value:[y],onPointerLeave:G,onPointerDown:G,onPointerMove:W,onValueChange:X,onValueCommit:ne,step:.1}),a.jsx("div",{ref:t,className:`${gt} ${u?Ct:wt}`,children:a.jsx("p",{className:Et,children:`-${Te(c)}`})})]})}function dr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function fr(){const e=A(i=>i.startDate),t=A(i=>i.setDelay),n=e?e.getTime():0,s=()=>t(dt(n));return a.jsx(ee,{onClick:s,children:a.jsx(dr,{})})}function Tt(){const e=h(t=>t.error);return e?a.jsxs("div",{className:Ee,children:[a.jsx("h3",{className:xe,children:e.message}),e.code?a.jsxs("p",{className:Ne,children:["Code: ",e.code]}):null,e.tech?a.jsxs("p",{className:Ne,children:["Engine: ",e.tech]}):null]}):null}function _t({callback:e}){const t=h(n=>n.eventEmitter);return d.useEffect(()=>{const n=()=>e("play",void 0),s=()=>e("pause",void 0),i=()=>e("ended",void 0),l=()=>e("seeking",void 0),u=()=>e("seeked",void 0),o=x=>e("timeUpdate",x),c=x=>e("volumeChange",x),m=x=>e("fullscreenChange",x),v=x=>e("qualityChange",x),w=x=>e("loadedMetadata",x),b=()=>e("loadStart",void 0),_=()=>e("playing",void 0),L=()=>e("waiting",void 0),O=()=>e("error",void 0);return t.on("play",n),t.on("pause",s),t.on("ended",i),t.on("seeking",l),t.on("seeked",u),t.on("timeUpdate",o),t.on("volumeChange",c),t.on("fullscreenChange",m),t.on("qualityChange",v),t.on("loadedMetadata",w),t.on("loadStart",b),t.on("playing",_),t.on("waiting",L),t.on("error",O),()=>{t.off("play",n),t.off("pause",s),t.off("ended",i),t.off("seeking",l),t.off("seeked",u),t.off("timeUpdate",o),t.off("volumeChange",c),t.off("fullscreenChange",m),t.off("qualityChange",v),t.off("loadedMetadata",w),t.off("loadStart",b),t.off("playing",_),t.off("waiting",L),t.off("error",O)}},[e,t]),null}const te={playerContainer:"_playerContainer_rry4k_1",controlsBottom:"_controlsBottom_rry4k_29",controlsContainer:"_controlsContainer_rry4k_45",controlsRow:"_controlsRow_rry4k_61",controlsSection:"_controlsSection_rry4k_68",controlsSectionStart:"_controlsSectionStart_rry4k_75",controlsSectionEnd:"_controlsSectionEnd_rry4k_79"},Rt=te.playerContainer,St=te.controlsBottom,Pt=te.controlsContainer,bt=te.controlsRow,jt=`${te.controlsSection} ${te.controlsSectionStart}`,kt=`${te.controlsSection} ${te.controlsSectionEnd}`;function hr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function mr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function Lt(){const e=h(m=>m.containerRef),t=h(m=>m.exitFullscreen),n=h(m=>m.isFullscreen),s=h(m=>m.requestFullscreen),i=h(m=>m.setIsFullscreen),l=h(m=>m.setIsFullscreenReady),u=h(m=>m.techRef),o=d.useCallback(m=>{m.stopPropagation(),i(kn())},[i]),c=()=>{n?t():s()};return d.useEffect(()=>{const m=at?u.current:e.current;if(m)return In(m,o)},[e,o,u]),d.useEffect(()=>{l(!0)},[l]),a.jsx(ee,{onClick:c,children:n?a.jsx(mr,{}):a.jsx(hr,{})})}const Oe={idleCheckContainer:"_idleCheckContainer_iz9tu_1",idleCheckContainerIdle:"_idleCheckContainerIdle_iz9tu_10",idleCheckContainerActive:"_idleCheckContainerActive_iz9tu_15"},pr=5*1e3;function Dt({children:e}){const t=d.useRef(null),[n,s]=d.useState(!1),i=d.useRef(null),u=h(w=>w.idleLocks).size,o=d.useCallback(()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null)},[]),c=d.useCallback(()=>{o(),i.current=window.setTimeout(()=>s(!0),pr)},[o]);d.useEffect(()=>(s(!1),c(),()=>{o()}),[o,c]),d.useEffect(()=>{const w=t.current;if(!w)return;const b=L=>{n&&(L.stopPropagation(),s(!1),c())},_=()=>{n&&s(!1),c()};return w.addEventListener("click",b),w.addEventListener("mousemove",_),()=>{w.removeEventListener("click",b),w.removeEventListener("mousemove",_)}},[t,n,s,c]);const m=n&&!u,v=`${Oe.idleCheckContainer} ${m?Oe.idleCheckContainerIdle:Oe.idleCheckContainerActive}`;return a.jsx("div",{ref:t,className:v,children:e})}const vr={spinner:"_spinner_oo4hi_10"};function yr(e){return a.jsx("div",D({className:vr.spinner},e))}function gr(e,t=500){const[n,s]=d.useState(e);return d.useEffect(()=>{const i=window.setTimeout(()=>s(e),t);return()=>{window.clearTimeout(i)}},[e,t]),n}const Cr={loadingContainer:"_loadingContainer_v9v7r_1"};function It(n){var s=n,{style:e}=s,t=q(s,["style"]);const i=h(u=>u.isLoading);return gr(i,100)?a.jsx("div",ge(D({className:Cr.loadingContainer,style:e},t),{children:a.jsx(yr,{})})):null}function wr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function Er(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const Ft={dropdownMenuContent:"_dropdownMenuContent_1gwy6_1",dropdownMenuItem:"_dropdownMenuItem_1gwy6_80"},xr=le.Root,Tr=le.Trigger,_r=le.Portal,Mt=d.forwardRef((i,s)=>{var l=i,{sideOffset:e=4,className:t}=l,n=q(l,["sideOffset","className"]);return a.jsx(le.Content,D({ref:s,sideOffset:e,className:[Ft.dropdownMenuContent,t].filter(Boolean).join(" "),onCloseAutoFocus:u=>{u.preventDefault()}},n))});Mt.displayName="PlayerDropdownMenuContent";const Nt=d.forwardRef((s,n)=>{var i=s,{className:e}=i,t=q(i,["className"]);return a.jsx(le.Item,D({ref:n,className:[Ft.dropdownMenuItem,e].filter(Boolean).join(" ")},t))});Nt.displayName="PlayerDropdownMenuItem";const Vt="settings";function Ot(){const[e,t]=d.useState(!1),n=h(c=>c.containerRef),s=h(c=>c.addIdleLock),i=h(c=>c.removeIdleLock),l=h(c=>c.levels),u=h(c=>c.setLevel),o=d.useCallback(c=>{t(c),c?s(Vt):i(Vt)},[s,i]);return a.jsxs(xr,{open:e,onOpenChange:o,children:[a.jsx(Tr,{asChild:!0,children:a.jsx(ee,{children:a.jsx(Er,{})})}),a.jsx(_r,{container:n.current,children:a.jsx(Mt,{side:"top",align:"end",children:l==null?void 0:l.map(c=>a.jsxs(Nt,{onClick:()=>u(c.value),children:[c.label,c.selected&&a.jsx(wr,{})]},c.sid))})})]})}function Rr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function Sr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Pr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const Ht={volumeSlider:"_volumeSlider_59ltz_1",volumeContainer:"_volumeContainer_59ltz_7"},At="volume";function Ut(){const e=h(o=>o.setVolume),t=h(o=>o.volume),n=h(o=>o.addIdleLock),s=h(o=>o.removeIdleLock),i=o=>{e(o[0]),n(At)},l=()=>{s(At)},u=()=>e(t?0:100);return a.jsxs("div",{className:Ht.volumeContainer,children:[a.jsx(ee,{onClick:u,className:"shrink-0",children:t?t>50?a.jsx(Rr,{}):a.jsx(Sr,{}):a.jsx(Pr,{})}),a.jsx("div",{className:Ht.volumeSlider,children:a.jsx(Se,{value:[t],onValueChange:i,onValueCommit:l})})]})}function Bt(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const s=o=>typeof window=="undefined"?t:window.matchMedia(o).matches,[i,l]=d.useState(()=>n?s(e):t);function u(){l(s(e))}return st(()=>{if(typeof window=="undefined")return;const o=window.matchMedia(e);return u(),o.addListener?o.addListener(u):o.addEventListener("change",u),()=>{o.removeListener?o.removeListener(u):o.removeEventListener("change",u)}},[e]),i}function br(e){return a.jsx(qn,{children:a.jsx(jr,D({},e))})}function jr({url:e,messages:t,onEvent:n}){const s=Bt("(min-width: 1024px)"),i=h(l=>l.containerRef);return a.jsxs("div",{ref:i,className:Rt,children:[a.jsxs(Xn,{url:e,eventFinishedMessage:t==null?void 0:t.eventFinished,eventNotStartedMessage:t==null?void 0:t.eventNotStarted,eventStartingSoonMessage:t==null?void 0:t.eventStartingSoon,children:[a.jsx(sr,{url:e}),a.jsx(Tt,{}),a.jsx(It,{}),a.jsxs(Dt,{children:[s?a.jsx(ar,{}):null,a.jsx("div",{className:St,children:a.jsxs("div",{className:Pt,children:[a.jsx(ur,{}),a.jsxs("div",{className:bt,children:[a.jsxs("div",{className:jt,children:[a.jsx(cr,{}),a.jsx(fr,{}),a.jsx(Ut,{})]}),a.jsxs("div",{className:kt,children:[a.jsx(lr,{message:t==null?void 0:t.live}),a.jsx(Ot,{}),a.jsx(Lt,{})]})]})]})})]})]}),a.jsx(Qn,{}),n&&a.jsx(_t,{callback:n})]})}function kr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.play),s=()=>{e?t():n()};return a.jsx(ht,{onClick:s})}function Lr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.play),s=()=>{e?t():n()};return a.jsx(ee,{onClick:s,children:e?a.jsx(pt,{}):a.jsx(vt,{})})}const Wt="vod-player-progress-bar";function Dr(){const e=d.useRef(null),t=d.useRef(null),[n,s]=d.useState(!1),[i,l]=d.useState(-1),[u,o]=d.useState(-1),c=h(C=>C.currentTime),m=h(C=>C.duration),v=h(C=>C.seek),w=h(C=>C.addIdleLock),b=h(C=>C.removeIdleLock),_=parseFloat((m?(u!==-1?u:c)/m*100:0).toFixed(1)),L=C=>{o(m*(C[0]/100)),w(Wt)},O=()=>{u!==-1&&(v(u),o(-1),b(Wt))},x=()=>s(!0),H=()=>s(!1),j=d.useCallback(C=>{const I=e.current,y=t.current;if(I&&y){const X=Pe(I),ne=Pe(y),re=(C.pageX||C.clientX)-X.left,G=re/X.width;if(G<0)return;let W=re-ne.width/2;W<0&&(W=0),W>X.width-ne.width&&(W=-1),y.style.left=W>-1?`${W}px`:"auto",y.style.right=W>-1?"auto":"0px",l(G*m)}x()},[m]);return a.jsxs("div",{className:yt,children:[a.jsx(Se,{ref:e,value:[_],onPointerLeave:H,onPointerDown:H,onPointerMove:j,onValueChange:L,onValueCommit:O,step:.1}),a.jsx("div",{ref:t,className:`${gt} ${n?Ct:wt}`,children:a.jsx("p",{className:Et,children:Te(i)})})]})}const He={remainingTime:"_remainingTime_1c40f_1",time:"_time_1c40f_7",separator:"_separator_1c40f_18"},Ir=He.remainingTime,zt=He.time,Fr=He.separator;function Mr(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return a.jsxs("div",{className:Ir,children:[a.jsx("p",{className:zt,children:Te(e)}),a.jsx("p",{className:Fr}),a.jsx("p",{className:zt,children:Te(t)})]})}function Nr(){const e=h(o=>o.currentTime),t=h(o=>o.duration),n=h(o=>o.isPlaying),s=h(o=>o.pause),i=h(o=>o.play),l=h(o=>o.seek),u=d.useCallback(o=>{let c=!1;if(!(o.target instanceof HTMLInputElement||o.ctrlKey)){switch(o.code){case"ArrowLeft":l(e-10>=0?e-10:0),c=!0;break;case"ArrowRight":l(e+10<t?e+10:t),c=!0;break;case"Space":n?s():i(),c=!0;break}c&&o.preventDefault()}},[e,t,n,s,i,l]);return d.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),a.jsx(ct,{})}function Vr(e){return a.jsx(ut,{children:a.jsx(Or,D({},e))})}function Or({url:e,onEvent:t,startTime:n}){const s=Bt("(min-width: 1024px)"),i=h(u=>u.setStartTime),l=h(u=>u.containerRef);return d.useEffect(()=>{n&&i(n)},[n,i]),a.jsxs("div",{ref:l,className:Rt,children:[a.jsx(ft,{url:e,isLive:!1}),a.jsx(Tt,{}),a.jsx(It,{}),a.jsxs(Dt,{children:[s?a.jsx(kr,{}):null,a.jsx("div",{className:St,children:a.jsxs("div",{className:Pt,children:[a.jsx(Dr,{}),a.jsxs("div",{className:bt,children:[a.jsxs("div",{className:jt,children:[a.jsx(Lr,{}),a.jsx(Ut,{}),a.jsx(Mr,{})]}),a.jsxs("div",{className:kt,children:[a.jsx(Ot,{}),a.jsx(Lt,{})]})]})]})})]}),a.jsx(Nr,{}),t&&a.jsx(_t,{callback:t})]})}R.LivePlayer=br,R.VodPlayer=Vr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
14
|
+
<%s key={someKey} {...props} />`,Xe,ce,no,ce),Jt[ce+Xe]=!0}}return r===o?Qr(B):Jr(B),B}}function qr(r,m,p){return Qt(r,m,p,!0)}function $r(r,m,p){return Qt(r,m,p,!1)}var eo=$r,to=qr;we.Fragment=o,we.jsx=eo,we.jsxs=to})()),we}var ot;function dn(){return ot||(ot=1,process.env.NODE_ENV==="production"?Re.exports=cn():Re.exports=un()),Re.exports}var a=dn();const ae={playerNotice:"_playerNotice_1m0i8_1",playerNoticeTitle:"_playerNoticeTitle_1m0i8_17",playerNoticeText:"_playerNoticeText_1m0i8_26"},it=typeof window!="undefined"?f.useLayoutEffect:f.useEffect;function Oe(e,t){const n=f.useRef(e);it(()=>{n.current=e},[e]),f.useEffect(()=>{if(t===null)return;const o=setInterval(()=>{n.current()},t);return()=>{clearInterval(o)}},[t])}function fn(e){const[,t]=f.useState(0);Oe(()=>t(n=>n+1),e)}const hn=()=>U.create(e=>({delay:0,startDate:null,setDelay:t=>e({delay:t}),setStartDate:t=>e({startDate:t})})),at=f.createContext(null),mn=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=hn()),a.jsx(at.Provider,{value:t.current,children:e})},H=e=>{const t=f.useContext(at);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return U.useStore(t,e)};function pn(e,t,n){const o={days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001};return e*(o[t]/o[n])}function vn(e){return pn(e,"milliseconds","seconds")}const Ce=e=>{if(isNaN(e)||e===1/0)return"0:00";const t=c=>(c<10?"0":"")+c,n=Math.floor(e/3600),o=Math.floor(e%3600/60),s=Math.floor(e%60);return n===0?`${o}:${t(s)}`:`${n}:${t(o)}:${t(s)}`};function yn(e,t){var n,o,s,c,u,i;if(typeof Intl!="undefined"&&Intl.DateTimeFormat)try{const d=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),w=parseInt(((n=d.find(k=>k.type==="year"))==null?void 0:n.value)||"0",10),g=parseInt(((o=d.find(k=>k.type==="month"))==null?void 0:o.value)||"0",10)-1,y=parseInt(((s=d.find(k=>k.type==="day"))==null?void 0:s.value)||"0",10),E=parseInt(((c=d.find(k=>k.type==="hour"))==null?void 0:c.value)||"0",10),I=parseInt(((u=d.find(k=>k.type==="minute"))==null?void 0:u.value)||"0",10),P=parseInt(((i=d.find(k=>k.type==="second"))==null?void 0:i.value)||"0",10);return new Date(w,g,y,E,I,P)}catch(l){return console.warn(`Failed to convert date to timezone ${t}, returning original date:`,l),e}return console.warn("Intl.DateTimeFormat not available, timezone conversion may be inaccurate"),e}function st(e){var n;const t=typeof window!="undefined"&&((n=window.navigator)==null?void 0:n.userAgent)||"";return e.test(t)}const lt=st(/iPhone|iPad|iPod/i),gn=st(/Tizen/i);function wn(){const e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function Cn(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.webkitEnterFullScreen?e.webkitEnterFullScreen():e.mozRequestFullScreen&&e.mozRequestFullScreen()}function Tn(e){e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen&&e.mozCancelFullScreen()}function En(e,t){return e.addEventListener("fullscreenchange",t),e.addEventListener("webkitfullscreenchange",t),e.addEventListener("mozfullscreenchange",t),e.addEventListener("MSFullscreenChange",t),()=>{e.removeEventListener("fullscreenchange",t),e.removeEventListener("webkitfullscreenchange",t),e.removeEventListener("mozfullscreenchange",t),e.removeEventListener("MSFullscreenChange",t)}}const _n=()=>ee(),xn=(e,t)=>({currentTime:0,duration:0,isEnded:!1,isLoading:!1,isLoop:!1,isMetaLoaded:!1,isPlaying:!1,isReady:!1,isStarted:!1,pauseTime:0,seekTime:-1,startTime:-1,volume:100,destroy:()=>{},handleDurationChange:()=>{const n=t().techRef.current;n&&e({duration:n.duration})},handleEnd:()=>{t().techRef.current&&(t().eventEmitter.emit("ended"),e({isEnded:!0,isLoading:!1,isMetaLoaded:!1,isPlaying:!1}))},handleLoadedMetadata:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadedMetadata",{duration:n.duration}),n.loop=t().isLoop,n.volume=n.muted?0:1,t().startTime!==-1&&(n.currentTime=t().startTime),e({currentTime:t().startTime!==-1?t().startTime:n.currentTime,duration:n.duration,startTime:-1,isMetaLoaded:!0,volume:n.muted?0:100}))},handleLoadStart:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadStart"),e({isReady:!0}),n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})}))},handlePause:()=>{t().techRef.current&&(t().eventEmitter.emit("pause"),e({isPlaying:!1,pauseTime:Date.now()}))},handlePlay:()=>{t().techRef.current&&(t().eventEmitter.emit("play"),e({isPlaying:!0,pauseTime:0}))},handlePlaying:()=>{t().techRef.current&&(t().eventEmitter.emit("playing"),e({isLoading:!1}))},handleSeeked:()=>{t().techRef.current&&(t().eventEmitter.emit("seeked"),e({isLoading:!1}))},handleSeeking:()=>{t().techRef.current&&(t().eventEmitter.emit("seeking"),e({isLoading:!0}))},handleTimeUpdate:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("timeUpdate",{currentTime:n.currentTime,duration:n.duration}),e({currentTime:n.currentTime}))},handleWaiting:()=>{t().techRef.current&&(t().eventEmitter.emit("waiting"),e({isLoading:!0}))},handleVolumeChange:()=>{const n=t().techRef.current;n&&t().eventEmitter.emit("volumeChange",{volume:n.volume})},handleError:n=>{const o=t().techRef.current;if(!o)return;t().eventEmitter.emit("error",n);const s=o.error;if(!s)return;const c=`${s.code}`,u=s.message||"Unknown error occurred";e({error:{message:u,code:c,tech:"native"}})},pause:()=>{const n=t().techRef.current;n&&(n.pause(),e({isEnded:!1,isPlaying:!1,pauseTime:Date.now()}))},getPauseTimeDiff:()=>!t().isStarted||!t().pauseTime?0:parseInt(vn(Date.now()-t().pauseTime).toFixed(0)),play:()=>{const n=t().techRef.current;n&&n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})})},seek:n=>{const o=t().techRef.current;o&&(o.currentTime=n,(o.paused||o.ended)&&o.play(),e({seekTime:-1,currentTime:n,isStarted:!0,isEnded:!1,isPlaying:!0}))},setIsLoading:n=>e({isLoading:n}),setIsLoop:n=>{const o=t().techRef.current;o&&(o.loop=n,e({isLoop:n}))},setStartTime:n=>e({startTime:n}),setVolume:n=>{const o=t().techRef.current;o&&(o.muted=n===0,o.volume=n/100,e({volume:n}))},stop:()=>{t().techRef.current&&e({isPlaying:!1,isLoading:!1})}}),Rn=(e,t)=>({isIdle:!1,setIsIdle:n=>e({isIdle:n}),resetIdle:()=>t().eventEmitter.emit("resetIdle")}),Sn=e=>({idleLocks:new Set,addIdleLock:t=>e(n=>({idleLocks:new Set(n.idleLocks).add(t)})),removeIdleLock:t=>e(n=>{const o=new Set(n.idleLocks);return o.delete(t),{idleLocks:o}})}),bn=(e,t)=>({level:null,levels:null,setLevels:n=>e({levels:n}),setLevel:n=>{n&&t().eventEmitter.emit("qualityChange",{level:n}),e({level:n})}}),Pn=(e,t)=>({isFullscreen:!1,isFullscreenReady:!1,exitFullscreen:()=>{t().eventEmitter.emit("fullscreenChange",{isFullscreen:!1}),Tn(document),e({isFullscreen:!1})},requestFullscreen:()=>{const n=t().techRef.current,o=t().containerRef.current;if(!n||!o)return;t().eventEmitter.emit("fullscreenChange",{isFullscreen:!0});const s=lt?n:o;s&&Cn(s),e({isFullscreen:!0})},setIsFullscreen:n=>e({isFullscreen:n}),setIsFullscreenReady:n=>e({isFullscreenReady:n})}),jn=e=>({error:null,setError:t=>e({error:t})}),kn=()=>({eventEmitter:_n()}),Ln=e=>()=>L({},e),In=(e,t)=>U.create()((...n)=>L(L(L(L(L(L(L(L({},xn(...n)),Rn(...n)),Sn(...n)),Pn(...n)),bn(...n)),jn(...n)),kn(...n)),Ln({techRef:e,containerRef:t})(...n))),ct=f.createContext(null);function Dn({children:e}){const t=f.useRef(null),n=f.useRef(null),o=f.useRef(null);return t.current||(t.current=In(n,o)),a.jsx(ct.Provider,{value:t.current,children:e})}const h=e=>{const t=f.useContext(ct);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return U.useStore(t,e)};function Mn(e){const t=e.split(`
|
|
15
|
+
`);for(const n of t){const o=n.trim();if(o.startsWith("#EXT-X-PROGRAM-DATE-TIME:")){const s=o.replace("#EXT-X-PROGRAM-DATE-TIME:","").trim(),c=new Date(s);if(!isNaN(c.getTime()))return yn(c,"Europe/Sarajevo")}}return null}function Fn(e,t){const n=e.split(`
|
|
16
|
+
`);let o=!1;for(const s of n){const c=s.trim();if(c.startsWith("#EXT-X-STREAM-INF:")){o=!0;continue}if(o&&!c.startsWith("#")){if(c.startsWith("http"))return c;{const u=new URL(t);return new URL(c,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function Nn(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function Vn(e){try{const t=Nn(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const o=await n.text(),s=Fn(o,t);if(!s)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",s);const c=await fetch(s);if(!c.ok)throw new Error(`Failed to fetch chunklist: ${c.status} ${c.statusText}`);const u=await c.text(),i=Mn(u);return i?console.log("Successfully detected start time:",i.toISOString()):console.log(" No start time found in chunklist"),i}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function An(n){var o=n,{url:e}=o,t=re(o,["url"]);const[s,c]=f.useState(!0),u=H(d=>d.startDate),i=H(d=>d.setStartDate),l=f.useCallback(async()=>{const d=await Vn(e);d&&i(d)},[e,i]);return f.useEffect(()=>{(async()=>{c(!0),await l(),c(!1)})()},[l]),Oe(l,u?null:5e3),s?null:a.jsx(On,L({},t))}function On({children:e,messages:t={}}){var u,i,l;const n=H(d=>d.startDate),o=h(d=>d.isStarted);return fn(o?null:5e3),n?Date.now()<n.getTime()?a.jsx(Hn,{startDate:n,title:(i=t==null?void 0:t.eventNotStarted)!=null?i:"Event has not started yet.",message:(l=t==null?void 0:t.eventStartingSoon)!=null?l:"Starting in few seconds..."}):a.jsx(a.Fragment,{children:e}):a.jsx("div",{className:ae.playerNotice,children:a.jsx("h3",{className:ae.playerNoticeTitle,children:(u=t==null?void 0:t.eventNotStarted)!=null?u:"Event has not started yet."})})}function Hn({startDate:e,title:t,message:n}){const o=e.getTime()-Date.now(),s=Math.floor(o/(1e3*60*60)),c=Math.floor(o%(1e3*60*60)/(1e3*60));return s||c?a.jsxs("div",{className:ae.playerNotice,children:[a.jsx("h3",{className:ae.playerNoticeTitle,children:t}),a.jsxs("p",{className:ae.playerNoticeText,children:["(",s>0?`${s}h ${c}m`:`${c}m`,")"]})]}):a.jsx("div",{className:ae.playerNotice,children:a.jsx("h3",{className:ae.playerNoticeTitle,children:n})})}function ut({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=()=>e("play",void 0),o=()=>e("pause",void 0),s=()=>e("ended",void 0),c=()=>e("seeking",void 0),u=()=>e("seeked",void 0),i=P=>e("volumeChange",P),l=P=>e("fullscreenChange",P),d=P=>e("qualityChange",P),w=P=>e("loadedMetadata",P),g=()=>e("loadStart",void 0),y=()=>e("playing",void 0),E=()=>e("waiting",void 0),I=()=>e("error",void 0);return t.on("play",n),t.on("pause",o),t.on("ended",s),t.on("seeking",c),t.on("seeked",u),t.on("volumeChange",i),t.on("fullscreenChange",l),t.on("qualityChange",d),t.on("loadedMetadata",w),t.on("loadStart",g),t.on("playing",y),t.on("waiting",E),t.on("error",I),()=>{t.off("play",n),t.off("pause",o),t.off("ended",s),t.off("seeking",c),t.off("seeked",u),t.off("volumeChange",i),t.off("fullscreenChange",l),t.off("qualityChange",d),t.off("loadedMetadata",w),t.off("loadStart",g),t.off("playing",y),t.off("waiting",E),t.off("error",I)}},[e,t]),null}const dt=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),ft=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),Bn=(e,t)=>Math.max(0,(t-e)/1e3),Un=(e,t=0)=>{const o=t<0?0:t,s=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],c=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,c)).toFixed(o))}${s[c]}`};function zn({isAuto:e,level:t,levels:n}){const o=n.length,s=[];return o>1&&s.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(c,u){const i=c.height||c.bitrate||0,l=u.height||u.bitrate||0;return i===l?0:i>l?1:-1}),n.map(c=>{const{bitrate:u,height:i,index:l}=c;s.push({sid:`quality-level-${l}`,label:i?`${i}p`:Un(u),value:l,selected:o===1||!e&&l===t})}),s}function Wn({callback:e}){const t=H(c=>c.delay),n=H(c=>c.startDate),o=n?n.getTime():0,s=h(c=>c.eventEmitter);return f.useEffect(()=>{const c=()=>e("timeUpdate",{currentTime:ft(o,t),duration:-1});return s.on("timeUpdate",c),()=>{s.off("timeUpdate",c)}},[e,s]),a.jsx(ut,{callback:e})}function ht(){const e=h(i=>i.exitFullscreen),t=h(i=>i.isFullscreen),n=h(i=>i.isFullscreenReady),o=h(i=>i.requestFullscreen),s=h(i=>i.setVolume),c=h(i=>i.volume),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowUp":s(c+10<100?c+10:100),l=!0;break;case"ArrowDown":s(c-10>0?c-10:0),l=!0;break;case"KeyM":s(c===0?100:0),l=!0;break;case"KeyF":n&&(t?e():o(),l=!0);break}l&&i.preventDefault()}},[e,t,n,o,s,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function Zn(){const e=H(i=>i.delay),t=h(i=>i.isPlaying),n=h(i=>i.pause),o=h(i=>i.getPauseTimeDiff),s=h(i=>i.play),c=H(i=>i.setDelay),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e+10),l=!0;break;case"ArrowRight":c(e-10>0?e-10:0),l=!0;break;case"Space":if(t)n();else{const d=o();d&&c(e+d),s()}l=!0;break}l&&i.preventDefault()}},[e,o,t,n,s,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),a.jsx(ht,{})}function mt({children:e}){return a.jsx(Dn,{children:e})}function Kn({children:e}){return a.jsx(mn,{children:a.jsx(mt,{children:e})})}function Yn({url:e,isLive:t,messages:n}){const o=f.useRef(null),s=h(T=>T.level),c=h(T=>T.levels),u=h(T=>T.setLevel),i=h(T=>T.setLevels),l=h(T=>T.techRef),d=h(T=>T.setError),w=f.useRef(0),g=f.useRef(null),y=50,E=1e4,I=f.useCallback(T=>{if(o.current&&(o.current.nextLevel=T,u(null),c)){const M=c.map(v=>pe(L({},v),{selected:v.value===T}));i(M)}},[c,u,i,o]),P=f.useCallback(()=>{o.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),o.current.loadSource(e))},[e]),k=f.useCallback(()=>{if(!o.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),d(null),g.current&&(clearTimeout(g.current),g.current=null),w.current=0;const T=o.current.levels,M=o.current.currentLevel,v=o.current.autoLevelEnabled;i(zn({levels:T.map((z,Q)=>{const{bitrate:Y,height:A,width:F}=z;return{bitrate:Y,height:A,index:Q,width:F}}),level:M,isAuto:v}))},[d,i]),V=f.useCallback((T,M)=>{var v;if(console.error("[Player][HLS] ERROR",T,M),!!o.current&&M.fatal)switch(M.type){case te.ErrorTypes.NETWORK_ERROR:console.log("[Player][HLS] NETWORK_ERROR",M),t?M.details==="manifestLoadError"&&(w.current<y&&(g.current&&clearTimeout(g.current),w.current+=1,g.current=setTimeout(()=>{if(o.current)try{console.log("[Player][HLS] Retrying stream..."),o.current.loadSource(e)}catch(z){console.error("[Player][HLS] Retry failed:",z)}},E)),d({message:(v=n==null?void 0:n.eventFinished)!=null?v:"Live event will be back shortly.",code:"MANIFEST_LOAD_ERROR",tech:"hls"})):o.current.startLoad();break;case te.ErrorTypes.MEDIA_ERROR:o.current.recoverMediaError();break}},[t,e,d]),b=f.useCallback(()=>{if(!l.current)return;let T={startLevel:-1,maxBufferSize:30*1024*1024};gn?(T.backBufferLength=-1,T.enableWorker=!1):t?T.backBufferLength=10:T.backBufferLength=60;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(T)),console.log("[Player][HLS] Version",te.version),o.current=new te(T),o.current.attachMedia(l.current),o.current.on(te.Events.MEDIA_ATTACHED,P),o.current.on(te.Events.MANIFEST_LOADED,k),o.current.on(te.Events.ERROR,V)}catch(M){throw new Error(`Error initializing Hls: ${M}`)}},[k,P,V,t,l,e]),D=f.useCallback(()=>{o.current&&(o.current.off(te.Events.MEDIA_ATTACHED,P),o.current.off(te.Events.MANIFEST_LOADED,k),o.current.off(te.Events.ERROR,V),o.current.destroy(),o.current=null),g.current&&(clearTimeout(g.current),g.current=null),w.current=0},[k,P,V]);return f.useEffect(()=>{s!==null&&I(s)},[s,I]),f.useEffect(()=>(te.isSupported()&&b(),D),[D,b]),null}const Xn={playerVideo:"_playerVideo_wc0sm_1"};function pt({url:e,isLive:t,isMuted:n=!1,messages:o={}}){const s=h(v=>v.handleDurationChange),c=h(v=>v.handleEnd),u=h(v=>v.handleLoadedMetadata),i=h(v=>v.handleLoadStart),l=h(v=>v.handlePause),d=h(v=>v.handlePlay),w=h(v=>v.handlePlaying),g=h(v=>v.handleSeeked),y=h(v=>v.handleSeeking),E=h(v=>v.handleTimeUpdate),I=h(v=>v.handleWaiting),P=h(v=>v.handleVolumeChange),k=h(v=>v.handleError),V=h(v=>v.techRef),b=f.useRef(null),D=()=>t?{}:{onDurationChange:s,onSeeked:g,onSeeking:y,onTimeUpdate:T},T=()=>{(!b.current||Date.now()-b.current>=1e3)&&(E(),b.current=Date.now())},M=D();return a.jsxs(a.Fragment,{children:[a.jsx(Yn,{isLive:t,url:e,messages:o}),a.jsx("video",L({ref:V,className:Xn.playerVideo,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:c,onError:k,onLoadedMetadata:u,onLoadStart:i,onPause:l,onPlay:d,onPlaying:w,onWaiting:I,onVolumeChange:P,tabIndex:-1},M))]})}function Gn({url:e,messages:t={}}){const[n,o]=f.useState(null),s=H(u=>u.delay),c=f.useCallback(async()=>{o(s?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${s}.m3u8`):e)},[s,e]);return f.useEffect(()=>{c()},[c]),n?a.jsx(pt,{url:n,isLive:!0,messages:t}):null}function Jn(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const o=i=>typeof window=="undefined"?t:window.matchMedia(i).matches,[s,c]=f.useState(()=>n?o(e):t);function u(){c(o(e))}return it(()=>{if(typeof window=="undefined")return;const i=window.matchMedia(e);return u(),i.addListener?i.addListener(u):i.addEventListener("change",u),()=>{i.removeListener?i.removeListener(u):i.removeEventListener("change",u)}},[e]),s}const ue={playbackButton:"_playbackButton_lgsgw_1",seekIndicator:"_seekIndicator_lgsgw_23",seekIndicatorLeft:"_seekIndicatorLeft_lgsgw_49",seekIndicatorRight:"_seekIndicatorRight_lgsgw_53",seekIndicatorVisible:"_seekIndicatorVisible_lgsgw_57"},Qn=10;function vt(i){var l=i,{className:e,onClick:t,onForwardSeek:n,onBackwardSeek:o,maxForwardTime:s,maxBackwardTime:c}=l,u=re(l,["className","onClick","onForwardSeek","onBackwardSeek","maxForwardTime","maxBackwardTime"]);return Jn("(min-width: 1024px)")?a.jsx(qn,L({className:e,onClick:t},u)):a.jsx($n,L({className:e,maxForwardTime:s,maxBackwardTime:c,onForwardSeek:n,onBackwardSeek:o},u))}function qn(o){var s=o,{className:e,onClick:t}=s,n=re(s,["className","onClick"]);const c=f.useRef(null),u=h(E=>E.exitFullscreen),i=h(E=>E.isFullscreen),l=h(E=>E.requestFullscreen),d=E=>{y()?(g(),i?u():l()):w(E)},w=E=>{c.current=window.setTimeout(()=>{t==null||t(E),g()},200)},g=()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},y=()=>c.current!==null;return f.useEffect(()=>()=>{g()},[]),a.jsx("button",L({onClick:d,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},n))}function $n(u){var i=u,{className:e,maxForwardTime:t,maxBackwardTime:n,onForwardSeek:o,onBackwardSeek:s}=i,c=re(i,["className","maxForwardTime","maxBackwardTime","onForwardSeek","onBackwardSeek"]);const l=f.useRef(null),d=f.useRef({single:null,indicator:null,accumulate:null}),w=f.useRef(null),g=f.useRef(0),y=f.useRef(null),[E,I]=f.useState({visible:!1,direction:null,time:0}),P=h(v=>v.isIdle),k=h(v=>v.setIsIdle),V=h(v=>v.resetIdle),b=(v,z)=>v<z/2?"backward":"forward",D=v=>{if(!w.current)return;const z=v.changedTouches[0];if(!z)return;const Q=Date.now(),Y=w.current.getBoundingClientRect(),A=z.clientX-Y.left,F=z.clientY-Y.top;if(A<0||A>Y.width||F<0||F>Y.height)return;const q=l.current,X=q?Q-q.time:1/0,W=b(A,Y.width),ie=y.current!==null&&y.current===W&&q!==null&&X<700&&Math.abs(A-q.x)<100;if(q!==null&&y.current===null&&X<300&&Math.abs(A-q.x)<50||ie){v.preventDefault(),v.stopPropagation(),d.current.single&&(window.clearTimeout(d.current.single),d.current.single=null),V(),(y.current===null||y.current!==W)&&(g.current=0,y.current=W);const ne=W==="backward"?n:t;g.current=Math.min(g.current+Qn,ne!=null?ne:1/0),T(W,g.current),d.current.accumulate&&window.clearTimeout(d.current.accumulate),d.current.accumulate=window.setTimeout(()=>{const Z=g.current;Z>0&&(y.current==="backward"?s==null||s(Z):o==null||o(Z),g.current=0,y.current=null,l.current=null,M(),V()),d.current.accumulate=null},500),l.current={time:Q,x:A}}else{l.current={time:Q,x:A},d.current.single&&window.clearTimeout(d.current.single);const ne=y.current!==null?700:350;d.current.single=window.setTimeout(()=>{if(y.current===null){d.current.single=null;const Z=P;k(!Z),Z&&V()}l.current=null},ne)}},T=(v,z)=>{I({visible:!0,direction:v,time:z}),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.indicator=window.setTimeout(()=>{M()},700)},M=()=>{I({visible:!1,direction:null,time:0}),d.current.indicator&&(window.clearTimeout(d.current.indicator),d.current.indicator=null)};return f.useEffect(()=>()=>{d.current.single&&window.clearTimeout(d.current.single),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.accumulate&&window.clearTimeout(d.current.accumulate)},[]),a.jsxs(a.Fragment,{children:[a.jsx("button",L({ref:w,onTouchEnd:D,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},c)),E.visible&&a.jsxs("div",{className:`${ue.seekIndicator} ${ue.seekIndicatorVisible} ${E.direction==="backward"?ue.seekIndicatorLeft:ue.seekIndicatorRight}`,children:[E.direction==="backward"?"-":"+",Ce(E.time)]})]})}function er(){const e=h(l=>l.isPlaying),t=h(l=>l.pause),n=h(l=>l.getPauseTimeDiff),o=h(l=>l.play),s=H(l=>l.delay),c=H(l=>l.setDelay),u=H(l=>l.startDate),i=u?u.getTime():0;return a.jsx(vt,{onClick:()=>{if(e)t();else{const l=n();l&&c(s+l),o()}},onBackwardSeek:l=>{const d=s+l;c(d)},onForwardSeek:l=>{const d=Math.max(0,s-l);c(d)},maxBackwardTime:Math.floor(i),maxForwardTime:Math.floor(s)})}const yt={playerButton:"_playerButton_izwqq_1",playerButtonCircle:"_playerButtonCircle_izwqq_42"},le=f.forwardRef((s,o)=>{var c=s,{shape:e="circle",className:t}=c,n=re(c,["shape","className"]);const u=e==="circle"?yt.playerButtonCircle:"",i=[yt.playerButton,u,t].filter(Boolean).join(" ");return a.jsx("button",L({ref:o,className:i},n))});le.displayName="PlayerButton";const Se={liveIndicator:"_liveIndicator_1jczn_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1jczn_9",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1jczn_13"};function tr(n){var o=n,{message:e}=o,t=re(o,["message"]);const s=H(l=>l.delay),c=H(l=>l.setDelay),u=()=>{s&&c(0)},i=s?`${Se.liveIndicator} ${Se.liveIndicatorHasDelay}`:`${Se.liveIndicator} ${Se.liveIndicatorNoDelay}`;return a.jsxs(le,pe(L({onClick:u,shape:"square"},t),{children:[a.jsx("div",{className:i}),e||"Live"]}))}function gt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function wt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function nr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.getPauseTimeDiff),o=h(i=>i.play),s=H(i=>i.delay),c=H(i=>i.setDelay),u=()=>{if(e)t();else{const i=n();i&&c(s+i),o()}};return a.jsx(le,{onClick:u,children:e?a.jsx(gt,{}):a.jsx(wt,{})})}const oe={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},be={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Pe=f.forwardRef((c,s)=>{var u=c,{max:e=100,min:t=0,className:n}=u,o=re(u,["max","min","className"]);return a.jsxs(_e.Root,pe(L({ref:s,min:t,max:e,"aria-label":"Player progress",className:[be.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:i=>i.preventDefault()},o),{children:[a.jsx(_e.Track,{className:be.sliderTrack,children:a.jsx(_e.Range,{className:be.sliderRange})}),a.jsx(_e.Thumb,{className:be.sliderThumb})]}))});Pe.displayName="PlayerSlider";function je(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const Ct="vod-player-progress-bar";function rr(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(0),[s,c]=f.useState(0),[u,i]=f.useState(!1),[l,d]=f.useState(-1),[w,g]=f.useState(-1),y=H(F=>F.delay),E=H(F=>F.startDate),I=E?E.getTime():0,P=new Date().getTime(),k=H(F=>F.setDelay),V=h(F=>F.isPlaying),b=h(F=>F.addIdleLock),D=h(F=>F.removeIdleLock),T=f.useCallback(()=>{o(ft(I,y)),c(Bn(I,P))},[y,P,I]),M=parseFloat((s?(w!==-1?w:n)/s*100:0).toFixed(1)),v=F=>{g(s*(F[0]/100)),b(Ct)},z=()=>{if(w!==-1){const F=dt(I,w);k(F),g(-1),D(Ct)}},Q=()=>i(!0),Y=()=>i(!1),A=f.useCallback(F=>{const q=e.current,X=t.current;if(q&&X){const W=je(q),ie=je(X),fe=(F.pageX||F.clientX)-W.left,ne=fe/W.width;if(ne<0)return;let Z=fe-ie.width/2;Z<0&&(Z=0),Z>W.width-ie.width&&(Z=-1),X.style.left=Z>-1?`${Z}px`:"auto",X.style.right=Z>-1?"auto":"0px";const Te=s-ne*s;d(Te>0?Te:0)}Q()},[s]);return Oe(()=>T(),V?1e3:null),f.useEffect(()=>{T()},[T]),a.jsxs("div",{className:oe.progressSlider,children:[a.jsx(Pe,{ref:e,value:[M],onPointerLeave:Y,onPointerDown:Y,onPointerMove:A,onValueChange:v,onValueCommit:z,step:.1}),a.jsx("div",{ref:t,className:`${oe.tipContainer} ${u?oe.tipContainerVisible:oe.tipContainerHidden}`,children:a.jsx("p",{className:oe.tipContent,children:`-${Ce(l)}`})})]})}function or(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function ir(){const e=H(s=>s.startDate),t=H(s=>s.setDelay),n=e?e.getTime():0,o=()=>t(dt(n));return a.jsx(le,{onClick:o,children:a.jsx(or,{})})}function Tt(){const e=h(t=>t.error);return e?a.jsx("div",{className:ae.playerNotice,children:a.jsx("h3",{className:ae.playerNoticeTitle,children:e.message})}):null}const K={playerContainer:"_playerContainer_1fn8l_1",controlsBottom:"_controlsBottom_1fn8l_29",controlsContainer:"_controlsContainer_1fn8l_45",controlsRow:"_controlsRow_1fn8l_61",controlsSection:"_controlsSection_1fn8l_68",controlsSectionStart:"_controlsSectionStart_1fn8l_78",controlsSectionEnd:"_controlsSectionEnd_1fn8l_82"};function ar(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function sr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function Et(){const e=h(d=>d.containerRef),t=h(d=>d.exitFullscreen),n=h(d=>d.isFullscreen),o=h(d=>d.requestFullscreen),s=h(d=>d.setIsFullscreen),c=h(d=>d.setIsFullscreenReady),u=h(d=>d.techRef),i=f.useCallback(d=>{d.stopPropagation(),s(wn())},[s]),l=()=>{n?t():o()};return f.useEffect(()=>{const d=lt?u.current:e.current;if(d)return En(d,i)},[e,i,u]),f.useEffect(()=>{c(!0)},[c]),a.jsx(le,{onClick:l,children:n?a.jsx(sr,{}):a.jsx(ar,{})})}const He={idleCheckContainer:"_idleCheckContainer_iz9tu_1",idleCheckContainerIdle:"_idleCheckContainerIdle_iz9tu_10",idleCheckContainerActive:"_idleCheckContainerActive_iz9tu_15"},lr=5*1e3;function _t({children:e}){const t=f.useRef(null),n=h(y=>y.isIdle),o=h(y=>y.setIsIdle),s=f.useRef(null),u=h(y=>y.idleLocks).size,i=h(y=>y.eventEmitter),l=f.useCallback(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]),d=f.useCallback(()=>{l(),s.current=window.setTimeout(()=>o(!0),lr)},[l]);f.useEffect(()=>(o(!1),d(),()=>{l()}),[l,d]),f.useEffect(()=>{const y=t.current;if(!y)return;const E=P=>{n&&(P.stopPropagation(),o(!1),d())},I=()=>{n&&o(!1),d()};return y.addEventListener("click",E),y.addEventListener("mousemove",I),()=>{y.removeEventListener("click",E),y.removeEventListener("mousemove",I)}},[t,n,o,d]),f.useEffect(()=>{const y=()=>{o(!1),d()};return i.on("resetIdle",y),()=>{i.off("resetIdle",y)}},[i,o,d]);const w=n&&!u,g=`${He.idleCheckContainer} ${w?He.idleCheckContainerIdle:He.idleCheckContainerActive}`;return a.jsx("div",{ref:t,className:g,children:e})}const cr={spinner:"_spinner_oo4hi_10"};function ur(e){return a.jsx("div",L({className:cr.spinner},e))}function dr(e,t=500){const[n,o]=f.useState(e);return f.useEffect(()=>{const s=window.setTimeout(()=>o(e),t);return()=>{window.clearTimeout(s)}},[e,t]),n}const fr={loadingContainer:"_loadingContainer_v9v7r_1"};function xt(n){var o=n,{style:e}=o,t=re(o,["style"]);const s=h(u=>u.isLoading);return dr(s,100)?a.jsx("div",pe(L({className:fr.loadingContainer,style:e},t),{children:a.jsx(ur,{})})):null}function hr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function mr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const de={dropdownMenuContent:"_dropdownMenuContent_11aiz_1",dropdownMenuItem:"_dropdownMenuItem_11aiz_82",scrollAreaRoot:"_scrollAreaRoot_11aiz_124",scrollAreaViewport:"_scrollAreaViewport_11aiz_132",scrollAreaScrollbar:"_scrollAreaScrollbar_11aiz_140",scrollAreaThumb:"_scrollAreaThumb_11aiz_167"},pr=ve.Root,vr=ve.Trigger,yr=ve.Portal,Rt=f.forwardRef((c,s)=>{var u=c,{sideOffset:e=4,className:t,children:n}=u,o=re(u,["sideOffset","className","children"]);return a.jsx(ve.Content,pe(L({ref:s,sideOffset:e,className:[de.dropdownMenuContent,t].filter(Boolean).join(" "),onOpenAutoFocus:i=>{i.preventDefault()},onCloseAutoFocus:i=>{i.preventDefault()}},o),{children:a.jsxs(xe.Root,{className:de.scrollAreaRoot,type:"always",scrollHideDelay:0,children:[a.jsx(xe.Viewport,{className:de.scrollAreaViewport,children:n}),a.jsx(xe.Scrollbar,{className:de.scrollAreaScrollbar,orientation:"vertical",children:a.jsx(xe.Thumb,{className:de.scrollAreaThumb})})]})}))});Rt.displayName="PlayerMenuContent";const St=f.forwardRef((s,o)=>{var c=s,{className:e,onClick:t}=c,n=re(c,["className","onClick"]);const u=l=>{t==null||t(l)},i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t==null||t(l))};return a.jsx(ve.Close,{asChild:!0,children:a.jsx("div",L({ref:o,className:[de.dropdownMenuItem,e].filter(Boolean).join(" "),role:"menuitem",tabIndex:0,onClick:u,onKeyDown:i},n))})});St.displayName="PlayerMenuItem";const bt="settings";function Pt(){const[e,t]=f.useState(!1),n=h(l=>l.containerRef),o=h(l=>l.addIdleLock),s=h(l=>l.removeIdleLock),c=h(l=>l.levels),u=h(l=>l.setLevel),i=f.useCallback(l=>{t(l),l?o(bt):s(bt)},[o,s]);return a.jsxs(pr,{open:e,onOpenChange:i,children:[a.jsx(vr,{asChild:!0,children:a.jsx(le,{children:a.jsx(mr,{})})}),a.jsx(yr,{container:n.current,children:a.jsx(Rt,{side:"top",align:"end",children:c==null?void 0:c.map(l=>a.jsxs(St,{onClick:()=>u(l.value),children:[l.label,l.selected&&a.jsx(hr,{})]},l.sid))})})]})}function gr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function wr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Cr(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const jt={volumeContainer:"_volumeContainer_4d6jg_1",volumeSlider:"_volumeSlider_4d6jg_8"},kt="volume";function Lt(){const e=h(i=>i.setVolume),t=h(i=>i.volume),n=h(i=>i.addIdleLock),o=h(i=>i.removeIdleLock),s=i=>{e(i[0]),n(kt)},c=()=>{o(kt)},u=()=>e(t?0:100);return a.jsxs("div",{className:jt.volumeContainer,children:[a.jsx(le,{onClick:u,className:"shrink-0",children:t?t>50?a.jsx(gr,{}):a.jsx(wr,{}):a.jsx(Cr,{})}),a.jsx("div",{className:jt.volumeSlider,children:a.jsx(Pe,{value:[t],onValueChange:s,onValueCommit:c})})]})}function Tr(e){return a.jsx(Kn,{children:a.jsx(Er,L({},e))})}function Er({url:e,messages:t,onEvent:n}){const o=h(s=>s.containerRef);return a.jsxs("div",{ref:o,className:K.playerContainer,children:[a.jsxs(An,{url:e,messages:{eventNotStarted:t==null?void 0:t.eventNotStarted,eventStartingSoon:t==null?void 0:t.eventStartingSoon},children:[a.jsx(Gn,{url:e,messages:{eventFinished:t==null?void 0:t.eventFinished}}),a.jsx(Tt,{}),a.jsx(xt,{}),a.jsxs(_t,{children:[a.jsx(er,{}),a.jsx("div",{className:K.controlsBottom,children:a.jsxs("div",{className:K.controlsContainer,children:[a.jsx(rr,{}),a.jsxs("div",{className:K.controlsRow,children:[a.jsxs("div",{className:`${K.controlsSection} ${K.controlsSectionStart}`,children:[a.jsx(nr,{}),a.jsx(ir,{}),a.jsx(Lt,{})]}),a.jsxs("div",{className:`${K.controlsSection} ${K.controlsSectionEnd}`,children:[a.jsx(tr,{message:t==null?void 0:t.live}),a.jsx(Pt,{}),a.jsx(Et,{})]})]})]})})]})]}),a.jsx(Zn,{}),n&&a.jsx(Wn,{callback:n})]})}function _r(){const e=h(u=>u.isPlaying),t=h(u=>u.pause),n=h(u=>u.play),o=h(u=>u.currentTime),s=h(u=>u.duration),c=h(u=>u.seek);return a.jsx(vt,{onClick:()=>{e?t():n()},onBackwardSeek:u=>{const i=Math.max(0,o-u);c(i)},onForwardSeek:u=>{const i=Math.min(o+u,s);c(i)},maxBackwardTime:Math.floor(o),maxForwardTime:Math.floor(s-o)})}function xr(){const e=h(s=>s.isPlaying),t=h(s=>s.pause),n=h(s=>s.play),o=()=>{e?t():n()};return a.jsx(le,{onClick:o,children:e?a.jsx(gt,{}):a.jsx(wt,{})})}const It="vod-player-progress-bar";function Rr(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(!1),[s,c]=f.useState(-1),[u,i]=f.useState(-1),l=h(D=>D.currentTime),d=h(D=>D.duration),w=h(D=>D.seek),g=h(D=>D.addIdleLock),y=h(D=>D.removeIdleLock),E=parseFloat((d?(u!==-1?u:l)/d*100:0).toFixed(1)),I=D=>{i(d*(D[0]/100)),g(It)},P=()=>{u!==-1&&(w(u),i(-1),y(It))},k=()=>o(!0),V=()=>o(!1),b=f.useCallback(D=>{const T=e.current,M=t.current;if(T&&M){const v=je(T),z=je(M),Q=(D.pageX||D.clientX)-v.left,Y=Q/v.width;if(Y<0)return;let A=Q-z.width/2;A<0&&(A=0),A>v.width-z.width&&(A=-1),M.style.left=A>-1?`${A}px`:"auto",M.style.right=A>-1?"auto":"0px",c(Y*d)}k()},[d]);return a.jsxs("div",{className:oe.progressSlider,children:[a.jsx(Pe,{ref:e,value:[E],onPointerLeave:V,onPointerDown:V,onPointerMove:b,onValueChange:I,onValueCommit:P,step:.1}),a.jsx("div",{ref:t,className:`${oe.tipContainer} ${n?oe.tipContainerVisible:oe.tipContainerHidden}`,children:a.jsx("p",{className:oe.tipContent,children:Ce(s)})})]})}const ke={remainingTimeContainer:"_remainingTimeContainer_1yyhb_1",remainingTime:"_remainingTime_1yyhb_1",remainingSeparator:"_remainingSeparator_1yyhb_17"};function Sr(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return a.jsxs("div",{className:ke.remainingTimeContainer,children:[a.jsx("p",{className:ke.remainingTime,children:Ce(e)}),a.jsx("p",{className:ke.remainingSeparator}),a.jsx("p",{className:ke.remainingTime,children:Ce(t)})]})}function br({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=o=>e("timeUpdate",o);return t.on("timeUpdate",n),()=>{t.off("timeUpdate",n)}},[e,t]),a.jsx(ut,{callback:e})}function Pr(){const e=h(i=>i.currentTime),t=h(i=>i.duration),n=h(i=>i.isPlaying),o=h(i=>i.pause),s=h(i=>i.play),c=h(i=>i.seek),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e-10>=0?e-10:0),l=!0;break;case"ArrowRight":c(e+10<t?e+10:t),l=!0;break;case"Space":n?o():s(),l=!0;break}l&&i.preventDefault()}},[e,t,n,o,s,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),a.jsx(ht,{})}function jr(e){return a.jsx(mt,{children:a.jsx(kr,L({},e))})}function kr({url:e,onEvent:t,startTime:n}){const o=h(c=>c.setStartTime),s=h(c=>c.containerRef);return f.useEffect(()=>{n&&o(n)},[n,o]),a.jsxs("div",{ref:s,className:K.playerContainer,children:[a.jsx(pt,{url:e,isLive:!1}),a.jsx(Tt,{}),a.jsx(xt,{}),a.jsxs(_t,{children:[a.jsx(_r,{}),a.jsx("div",{className:K.controlsBottom,children:a.jsxs("div",{className:K.controlsContainer,children:[a.jsx(Rr,{}),a.jsxs("div",{className:K.controlsRow,children:[a.jsxs("div",{className:`${K.controlsSection} ${K.controlsSectionStart}`,children:[a.jsx(xr,{}),a.jsx(Lt,{}),a.jsx(Sr,{})]}),a.jsxs("div",{className:`${K.controlsSection} ${K.controlsSectionEnd}`,children:[a.jsx(Pt,{}),a.jsx(Et,{})]})]})]})})]}),a.jsx(Pr,{}),t&&a.jsx(br,{callback:t})]})}R.LivePlayer=Tr,R.VodPlayer=jr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
17
17
|
//# sourceMappingURL=react-video-player.umd.js.map
|