@eyevinn/web-player 0.7.2 → 0.7.3
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/webplayer.min.js +1 -1
- package/package.json +4 -4
package/dist/webplayer.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webplayer=t():e.webplayer=t()}(window,(function(){return function(e){function t(t){for(var n,i,a=t[0],o=t[1],s=0,l=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={0:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpwebplayer=window.webpackJsonpwebplayer||[],o=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var u=o;return i(i.s=271)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=void 0,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i=void 0,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return r(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability"}}]),e}());t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=1,u=2,l=3,c=4,d=5;function f(e){e=e||{};var t,n=this.context,a=(0,r.default)(n).getInstance(),o=e.settings,f=[],h=void 0,p=void 0,g=void 0;function v(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function y(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function _(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[d,this].concat(t))}function b(e,t){var n="",r=null;h&&(r=(new Date).getTime(),n+="["+(r-g)+"]"),p&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var s=arguments.length,u=Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){n+=e+" "})),f[e]&&o.get().debug.logLevel>=e&&f[e](n),o&&o.get().debug.dispatchEvent&&a.trigger(i.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:m.bind(e),error:y.bind(e),warn:E.bind(e),info:T.bind(e),debug:_.bind(e)}},setLogTimestampVisible:function(e){h=e},setCalleeNameVisible:function(e){p=e}},h=!0,p=!0,g=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(f[s]=v(window.console.error),f[u]=v(window.console.error),f[l]=v(window.console.warn),f[c]=v(window.console.info),f[d]=v(window.console.debug)),t}f.__dashjs_factory_name="Debug";var h=a.default.getSingletonFactory(f);h.LOG_LEVEL_NONE=0,h.LOG_LEVEL_FATAL=s,h.LOG_LEVEL_ERROR=u,h.LOG_LEVEL_WARNING=l,h.LOG_LEVEL_INFO=c,h.LOG_LEVEL_DEBUG=d,a.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(20));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}o.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(o);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(103);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var s=new(function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d}));var r,i,a,o,s=n(25);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(o=r||(r={}))[o.UNKNOWN=0]="UNKNOWN",o[o.HLS=1]="HLS",o[o.DASH=2]="DASH",o[o.MSS=3]="MSS",function(e){e[e.UNKNOWN_MANIFEST_TYPE=0]="UNKNOWN_MANIFEST_TYPE"}(i||(i={})),function(e){e.PLAY="play",e.PAUSE="pause",e.PLAYING="playing",e.TIME_UPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.WAITING="waiting",e.STALLED="stalled",e.VOLUME_CHANGE="volumechange",e.ENDED="ended",e.UNREADY="unready",e.READYING="readying",e.READY="ready",e.STATE_CHANGE="state_change",e.AUDIO_TRACK_CHANGE="audio_track_change",e.TEXT_TRACK_CHANGE="text_track_change",e.BUFFERING="buffering",e.LIVE_ENDED="live_ended",e.BITRATE_CHANGE="bitrate_change",e.PLAYER_STOPPED="player_stopped",e.ERROR="error"}(a||(a={}));var p,g=function(){function e(){this.emitter=Object(s.a)()}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();function v(e){return e?e.id+"|"+e.label+"|"+e.language:null}!function(e){e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.PLAYING=3]="PLAYING",e[e.PAUSED=4]="PAUSED",e[e.SEEKING=5]="SEEKING",e[e.BUFFERING=6]="BUFFERING",e[e.BITRATE_CHANGE=7]="BITRATE_CHANGE",e[e.PLAYER_STOPPED=8]="PLAYER_STOPPED"}(p||(p={}));var m,y=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).state={playbackState:p.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:r.muted,audioTracks:[],textTracks:[]},n.video=r,n.video.addEventListener("play",n.onPlay=n.onPlay.bind(d(n))),n.video.addEventListener("playing",n.onPlaying=n.onPlaying.bind(d(n))),n.video.addEventListener("pause",n.onPause=n.onPause.bind(d(n))),n.video.addEventListener("timeupdate",n.onTimeUpdate=n.onTimeUpdate.bind(d(n))),n.video.addEventListener("waiting",n.onWaiting=n.onWaiting.bind(d(n))),n.video.addEventListener("seeking",n.onSeeking=n.onSeeking.bind(d(n))),n.video.addEventListener("seeked",n.onSeeked=n.onSeeked.bind(d(n))),n.video.addEventListener("canplay",n.onLoadedData=n.onLoadedData.bind(d(n))),n.video.addEventListener("volumechange",n.onVolumeChange=n.onVolumeChange.bind(d(n))),n.video.addEventListener("ended",n.onEnded=n.onEnded.bind(d(n))),n.video.audioTracks&&n.video.audioTracks.addEventListener("change",n.onAudioTrackChange=n.onAudioTrackChange.bind(d(n))),n}c(t,e);var n=t.prototype;return n.updateState=function(e){var t=this;Object.keys(e).forEach((function(n){void 0!==t.state[n]&&(t.state[n]=e[n])})),this.emit(a.STATE_CHANGE,{state:this.state})},n.onLoadedData=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING,duration:this.duration,isLive:this.isLive,audioTracks:this.audioTracks,textTracks:this.textTracks})},n.onPlay=function(){this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAY)},n.onPause=function(){this.updateState({playbackState:p.PAUSED}),this.emit(a.PAUSE)},n.onPlaying=function(){this.state.playbackState!==p.PLAYING&&this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAYING)},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.duration-10,isSeekable:!this.isLive||this.duration>=300}),this.emit(a.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onWaiting=function(){this.state.playbackState!==p.SEEKING&&(this.updateState({playbackState:p.BUFFERING}),this.emit(a.BUFFERING)),this.emit(a.WAITING)},n.onSeeking=function(){this.updateState({playbackState:p.SEEKING}),this.emit(a.SEEKING)},n.onSeeked=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING}),this.emit(a.SEEKED)},n.onVolumeChange=function(){this.state.isMuted!==this.isMuted&&this.updateState({isMuted:this.isMuted}),this.emit(a.VOLUME_CHANGE,{volume:this.video.volume})},n.onAudioTrackChange=function(){this.updateState({audioTracks:this.audioTracks}),this.emit(a.AUDIO_TRACK_CHANGE)},n.onTextTrackChange=function(){this.updateState({textTracks:this.textTracks}),this.emit(a.TEXT_TRACK_CHANGE)},n.onEnded=function(){this.emit(a.ENDED),this.updateState({playbackState:p.IDLE})},n.onBitrateChange=function(){},n.play=function(){var e=this.video.play();return e?e.then((function(){return!0}),(function(){return!1})):Promise.resolve(!0)},n.pause=function(){this.video.pause()},n.mute=function(){this.video.muted=!0},n.unmute=function(){this.video.muted=!1},n.load=function(e){var t=this;return this.updateState({playbackState:p.LOADING}),new Promise((function(n,r){t.video.src=e,t.video.load(),n()}))},n.stop=function(){this.video.src="",this.video.load(),this.updateState({playbackState:p.IDLE,isLive:!1,currentTime:this.currentTime,duration:this.duration}),this.emit(a.PLAYER_STOPPED)},n.seekToLive=function(){this.currentTime=this.duration-10},n.getVideoLevels=function(){},n.destroy=function(){this.stop(),this.video.removeEventListener("timeupdate",this.onTimeUpdate)},l(t,[{key:"currentLevel",set:function(e){},get:function(){}},{key:"isPlaying",get:function(){return!this.video.paused}},{key:"isMuted",get:function(){return this.video.muted}},{key:"isLive",get:function(){return 1/0===this.video.duration}},{key:"duration",get:function(){return this.isLive&&this.video.seekable.length?this.video.seekable.end(0):this.video.duration||0}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,this.duration-10):e)}},{key:"audioTrack",get:function(){var e=this.audioTracks.find((function(e){return e.enabled}));return null==e?void 0:e.id},set:function(e){if(this.video.audioTracks)for(var t,n=h(this.video.audioTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=r.id===e}}},{key:"audioTracks",get:function(){var e;return Array.from(null!=(e=this.video.audioTracks)?e:[]).map((function(e){return{id:e.id,label:e.label,language:e.language,enabled:e.enabled}}))}},{key:"textTrack",get:function(){return v(this.textTracks.find((function(e){return e.enabled})))},set:function(e){if(this.video.textTracks)for(var t,n=h(this.video.textTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=v(r)===e}}},{key:"textTracks",get:function(){var e;return Array.from(null!=(e=this.video.textTracks)?e:[]).filter((function(e){return"metadata"!==e.kind})).map((function(e){return{id:v(e),label:e.label,language:e.language,enabled:e.enabled}}))}}]),t}(g),E={"application/x-mpegURL":r.HLS,"application/octet-stream":r.UNKNOWN,"binary/octet-stream":r.UNKNOWN,"application/vnd.apple.mpegurl":r.HLS,"application/dash+xml":r.DASH,"application/vnd.apple.mpegurl;charset=UTF-8":r.HLS,"application/vnd.ms-sstr+xml":r.MSS},T=((m={})[r.HLS]="application/vnd.apple.mpegurl",m[r.DASH]="application/dash+xml",m[r.MSS]="application/vnd.ms-sstr+xml",m);function _(e,t,n){if(!e.s){if(n instanceof b){if(!n.s)return void(n.o=_.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(_.bind(null,e,t),_.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var b=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{_(r,1,a(this.v))}catch(e){_(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?_(r,1,t?t(i):i):n?_(r,1,n(i)):_(r,2,i)}catch(e){_(r,2,e)}},r},e}(),S=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).video=r,n}c(t,e);var o=t.prototype;return o.load=function(e){try{var t=this;return t.emit(a.READYING),t.reset(),t.currentSrc=e,Promise.resolve((o=e,fetch(o).then((function(e){return E[e.headers.get("content-type")]||(o.match(/\.m3u8/)?r.HLS:o.match(/\.mpd/)?r.DASH:o.toLowerCase().match(/\/manifest/)?r.MSS:r.UNKNOWN)})).catch((function(){return r.UNKNOWN})))).then((function(o){function s(){return t.tech=new u({video:t.video}),t.tech.on("*",t.onEvent.bind(t)),t.emit(a.READY),t.tech.load(e)}if(o===r.UNKNOWN)throw{errorCode:i.UNKNOWN_MANIFEST_TYPE};var u,l=function(e,t){var n,r=-1;e:{for(var i=0;i<t.length;i++){var a=t[i][0];if(a){var o=a();if(o&&o.then)break e;if(o===e){r=i;break}}else r=i}if(-1!==r){do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then){n=!0;break e}var l=t[r][2];r++}while(l&&!l());return u}}var c=new b,d=_.bind(null,c,2);return(n?u.then(f):o.then((function n(o){for(;;){if(o===e){r=i;break}if(++i===t.length){if(-1!==r)break;return void _(c,1,u)}if(a=t[i][0]){if((o=a())&&o.then)return void o.then(n).then(void 0,d)}else r=i}do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then)return void u.then(f).then(void 0,d);var l=t[r][2];r++}while(l&&!l());_(c,1,u)}))).then(void 0,d),c;function f(e){for(;;){var n=t[r][2];if(!n||n())break;r++;for(var i=t[r][1];!i;)r++,i=t[r][1];if((e=i())&&e.then)return void e.then(f).then(void 0,d)}_(c,1,e)}}(o,[[function(){return r.HLS},function(){var e=function(){if(!function(e){return!!document.createElement("video").canPlayType(T[e])}(r.HLS)||(e=window.navigator.userAgent.toLowerCase(),!/safari/.test(e)&&!/iphone|ipad|ipod/.test(e)||!/apple computer/.test(window.navigator.vendor.toLowerCase())))return Promise.resolve(Promise.resolve().then(n.bind(null,98))).then((function(e){u=e.default}));var e;u=y}();if(e&&e.then)return e.then((function(){}))}],[function(){return r.DASH},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,99))).then((function(e){u=e.default}))}],[function(){return r.MSS},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,100))).then((function(e){u=e.default}))}]]);return l&&l.then?l.then(s):s()}))}catch(e){return Promise.reject(e)}var o},o.onEvent=function(e,t){this.emit(e,t)},o.getVideoLevels=function(){if(this.tech)return this.tech.getVideoLevels()},o.play=function(){var e;return null==(e=this.tech)?void 0:e.play()},o.pause=function(){var e;return null==(e=this.tech)?void 0:e.pause()},o.stop=function(){return this.destroy()},o.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;this.tech&&(r?t=r/100*this.tech.duration:n&&(t=this.tech.currentTime+n),this.tech.currentTime=t)},o.seekToLive=function(){var e;return null==(e=this.tech)?void 0:e.seekToLive()},o.setAudioTrack=function(e){this.tech&&(this.tech.audioTrack=e)},o.setTextTrack=function(e){this.tech&&(this.tech.textTrack=e)},o.mute=function(){var e;null==(e=this.tech)||e.mute()},o.unmute=function(){var e;null==(e=this.tech)||e.unmute()},o.reset=function(){this.tech&&(this.tech.destroy(),this.tech=null,this.emit(a.UNREADY))},l(t,[{key:"isPlaying",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isPlaying)&&e}},{key:"isMuted",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isMuted)&&e}},{key:"isLive",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isLive)&&e}},{key:"currentTime",get:function(){var e;return null==(e=this.tech)?void 0:e.currentTime}},{key:"currentLevel",get:function(){if(this.tech)return this.tech.currentLevel},set:function(e){this.tech&&(this.tech.currentLevel=e)}}]),t}(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webplayer=t():e.webplayer=t()}(window,(function(){return function(e){function t(t){for(var n,i,a=t[0],o=t[1],s=0,l=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={0:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpwebplayer=window.webpackJsonpwebplayer||[],o=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var u=o;return i(i.s=271)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=void 0,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i=void 0,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return r(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability"}}]),e}());t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=1,u=2,l=3,c=4,d=5;function f(e){e=e||{};var t,n=this.context,a=(0,r.default)(n).getInstance(),o=e.settings,f=[],h=void 0,p=void 0,g=void 0;function v(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function y(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function _(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[d,this].concat(t))}function b(e,t){var n="",r=null;h&&(r=(new Date).getTime(),n+="["+(r-g)+"]"),p&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var s=arguments.length,u=Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){n+=e+" "})),f[e]&&o.get().debug.logLevel>=e&&f[e](n),o&&o.get().debug.dispatchEvent&&a.trigger(i.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:m.bind(e),error:y.bind(e),warn:E.bind(e),info:T.bind(e),debug:_.bind(e)}},setLogTimestampVisible:function(e){h=e},setCalleeNameVisible:function(e){p=e}},h=!0,p=!0,g=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(f[s]=v(window.console.error),f[u]=v(window.console.error),f[l]=v(window.console.warn),f[c]=v(window.console.info),f[d]=v(window.console.debug)),t}f.__dashjs_factory_name="Debug";var h=a.default.getSingletonFactory(f);h.LOG_LEVEL_NONE=0,h.LOG_LEVEL_FATAL=s,h.LOG_LEVEL_ERROR=u,h.LOG_LEVEL_WARNING=l,h.LOG_LEVEL_INFO=c,h.LOG_LEVEL_DEBUG=d,a.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(20));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}o.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(o);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(103);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var s=new(function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d}));var r,i,a,o,s=n(25);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(o=r||(r={}))[o.UNKNOWN=0]="UNKNOWN",o[o.HLS=1]="HLS",o[o.DASH=2]="DASH",o[o.MSS=3]="MSS",function(e){e[e.UNKNOWN_MANIFEST_TYPE=0]="UNKNOWN_MANIFEST_TYPE"}(i||(i={})),function(e){e.PLAY="play",e.PAUSE="pause",e.PLAYING="playing",e.TIME_UPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.WAITING="waiting",e.STALLED="stalled",e.VOLUME_CHANGE="volumechange",e.ENDED="ended",e.UNREADY="unready",e.READYING="readying",e.READY="ready",e.STATE_CHANGE="state_change",e.AUDIO_TRACK_CHANGE="audio_track_change",e.TEXT_TRACK_CHANGE="text_track_change",e.BUFFERING="buffering",e.LIVE_ENDED="live_ended",e.BITRATE_CHANGE="bitrate_change",e.PLAYER_STOPPED="player_stopped",e.ERROR="error"}(a||(a={}));var p,g=function(){function e(){this.emitter=Object(s.a)()}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();function v(e){return e?e.id+"|"+e.label+"|"+e.language:null}!function(e){e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.PLAYING=3]="PLAYING",e[e.PAUSED=4]="PAUSED",e[e.SEEKING=5]="SEEKING",e[e.BUFFERING=6]="BUFFERING",e[e.BITRATE_CHANGE=7]="BITRATE_CHANGE",e[e.PLAYER_STOPPED=8]="PLAYER_STOPPED"}(p||(p={}));var m,y=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).state={playbackState:p.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:r.muted,audioTracks:[],textTracks:[]},n.video=r,n.video.addEventListener("play",n.onPlay=n.onPlay.bind(d(n))),n.video.addEventListener("playing",n.onPlaying=n.onPlaying.bind(d(n))),n.video.addEventListener("pause",n.onPause=n.onPause.bind(d(n))),n.video.addEventListener("timeupdate",n.onTimeUpdate=n.onTimeUpdate.bind(d(n))),n.video.addEventListener("waiting",n.onWaiting=n.onWaiting.bind(d(n))),n.video.addEventListener("seeking",n.onSeeking=n.onSeeking.bind(d(n))),n.video.addEventListener("seeked",n.onSeeked=n.onSeeked.bind(d(n))),n.video.addEventListener("canplay",n.onLoadedData=n.onLoadedData.bind(d(n))),n.video.addEventListener("volumechange",n.onVolumeChange=n.onVolumeChange.bind(d(n))),n.video.addEventListener("ended",n.onEnded=n.onEnded.bind(d(n))),n.video.audioTracks&&n.video.audioTracks.addEventListener("change",n.onAudioTrackChange=n.onAudioTrackChange.bind(d(n))),n}c(t,e);var n=t.prototype;return n.updateState=function(e){var t=this;Object.keys(e).forEach((function(n){void 0!==t.state[n]&&(t.state[n]=e[n])})),this.emit(a.STATE_CHANGE,{state:this.state})},n.onLoadedData=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING,duration:this.duration,isLive:this.isLive,audioTracks:this.audioTracks,textTracks:this.textTracks})},n.onPlay=function(){this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAY)},n.onPause=function(){this.updateState({playbackState:p.PAUSED}),this.emit(a.PAUSE)},n.onPlaying=function(){this.state.playbackState!==p.PLAYING&&this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAYING)},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.duration-10,isSeekable:!this.isLive||this.duration>=300}),this.emit(a.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onWaiting=function(){this.state.playbackState!==p.SEEKING&&(this.updateState({playbackState:p.BUFFERING}),this.emit(a.BUFFERING)),this.emit(a.WAITING)},n.onSeeking=function(){this.updateState({playbackState:p.SEEKING}),this.emit(a.SEEKING)},n.onSeeked=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING}),this.emit(a.SEEKED)},n.onVolumeChange=function(){this.state.isMuted!==this.isMuted&&this.updateState({isMuted:this.isMuted}),this.emit(a.VOLUME_CHANGE,{volume:this.video.volume})},n.onAudioTrackChange=function(){this.updateState({audioTracks:this.audioTracks}),this.emit(a.AUDIO_TRACK_CHANGE)},n.onTextTrackChange=function(){this.updateState({textTracks:this.textTracks}),this.emit(a.TEXT_TRACK_CHANGE)},n.onEnded=function(){this.emit(a.ENDED),this.updateState({playbackState:p.IDLE})},n.onBitrateChange=function(){},n.play=function(){var e=this.video.play();return e?e.then((function(){return!0}),(function(){return!1})):Promise.resolve(!0)},n.pause=function(){this.video.pause()},n.mute=function(){this.video.muted=!0},n.unmute=function(){this.video.muted=!1},n.load=function(e){var t=this;return this.updateState({playbackState:p.LOADING}),new Promise((function(n,r){t.video.src=e,t.video.load(),n()}))},n.stop=function(){this.video.src="",this.video.load(),this.updateState({playbackState:p.IDLE,isLive:!1,currentTime:this.currentTime,duration:this.duration}),this.emit(a.PLAYER_STOPPED)},n.seekToLive=function(){this.currentTime=this.duration-10},n.getVideoLevels=function(){return[]},n.destroy=function(){this.stop(),this.video.removeEventListener("timeupdate",this.onTimeUpdate)},l(t,[{key:"currentLevel",set:function(e){},get:function(){}},{key:"isPlaying",get:function(){return!this.video.paused}},{key:"isMuted",get:function(){return this.video.muted}},{key:"isLive",get:function(){return 1/0===this.video.duration}},{key:"duration",get:function(){return this.isLive&&this.video.seekable.length?this.video.seekable.end(0):this.video.duration||0}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,this.duration-10):e)}},{key:"audioTrack",get:function(){var e=this.audioTracks.find((function(e){return e.enabled}));return null==e?void 0:e.id},set:function(e){if(this.video.audioTracks)for(var t,n=h(this.video.audioTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=r.id===e}}},{key:"audioTracks",get:function(){var e;return Array.from(null!=(e=this.video.audioTracks)?e:[]).map((function(e){return{id:e.id,label:e.label,language:e.language,enabled:e.enabled}}))}},{key:"textTrack",get:function(){return v(this.textTracks.find((function(e){return e.enabled})))},set:function(e){if(this.video.textTracks)for(var t,n=h(this.video.textTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=v(r)===e}}},{key:"textTracks",get:function(){var e;return Array.from(null!=(e=this.video.textTracks)?e:[]).filter((function(e){return"metadata"!==e.kind})).map((function(e){return{id:v(e),label:e.label,language:e.language,enabled:e.enabled}}))}}]),t}(g),E={"application/x-mpegURL":r.HLS,"application/octet-stream":r.UNKNOWN,"binary/octet-stream":r.UNKNOWN,"application/vnd.apple.mpegurl":r.HLS,"application/dash+xml":r.DASH,"application/vnd.apple.mpegurl;charset=UTF-8":r.HLS,"application/vnd.ms-sstr+xml":r.MSS},T=((m={})[r.HLS]="application/vnd.apple.mpegurl",m[r.DASH]="application/dash+xml",m[r.MSS]="application/vnd.ms-sstr+xml",m);function _(e,t,n){if(!e.s){if(n instanceof b){if(!n.s)return void(n.o=_.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(_.bind(null,e,t),_.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var b=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{_(r,1,a(this.v))}catch(e){_(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?_(r,1,t?t(i):i):n?_(r,1,n(i)):_(r,2,i)}catch(e){_(r,2,e)}},r},e}(),S=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).video=r,n}c(t,e);var o=t.prototype;return o.load=function(e,t){void 0===t&&(t=!1);try{var o=this;return o.video.muted=t,o.video.autoplay=t,o.emit(a.READYING),o.reset(),o.currentSrc=e,Promise.resolve((s=e,fetch(s).then((function(e){return E[e.headers.get("content-type")]||(s.match(/\.m3u8/)?r.HLS:s.match(/\.mpd/)?r.DASH:s.toLowerCase().match(/\/manifest/)?r.MSS:r.UNKNOWN)})).catch((function(){return r.UNKNOWN})))).then((function(t){function s(){return o.tech=new u({video:o.video}),o.tech.on("*",o.onEvent.bind(o)),o.emit(a.READY),o.tech.load(e)}if(t===r.UNKNOWN)throw{errorCode:i.UNKNOWN_MANIFEST_TYPE};var u,l=function(e,t){var n,r=-1;e:{for(var i=0;i<t.length;i++){var a=t[i][0];if(a){var o=a();if(o&&o.then)break e;if(o===e){r=i;break}}else r=i}if(-1!==r){do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then){n=!0;break e}var l=t[r][2];r++}while(l&&!l());return u}}var c=new b,d=_.bind(null,c,2);return(n?u.then(f):o.then((function n(o){for(;;){if(o===e){r=i;break}if(++i===t.length){if(-1!==r)break;return void _(c,1,u)}if(a=t[i][0]){if((o=a())&&o.then)return void o.then(n).then(void 0,d)}else r=i}do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then)return void u.then(f).then(void 0,d);var l=t[r][2];r++}while(l&&!l());_(c,1,u)}))).then(void 0,d),c;function f(e){for(;;){var n=t[r][2];if(!n||n())break;r++;for(var i=t[r][1];!i;)r++,i=t[r][1];if((e=i())&&e.then)return void e.then(f).then(void 0,d)}_(c,1,e)}}(t,[[function(){return r.HLS},function(){var e=function(){if(!function(e){return!!document.createElement("video").canPlayType(T[e])}(r.HLS)||(e=window.navigator.userAgent.toLowerCase(),!/safari/.test(e)&&!/iphone|ipad|ipod/.test(e)||!/apple computer/.test(window.navigator.vendor.toLowerCase())))return Promise.resolve(Promise.resolve().then(n.bind(null,98))).then((function(e){u=e.default}));var e;u=y}();if(e&&e.then)return e.then((function(){}))}],[function(){return r.DASH},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,99))).then((function(e){u=e.default}))}],[function(){return r.MSS},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,100))).then((function(e){u=e.default}))}]]);return l&&l.then?l.then(s):s()}))}catch(e){return Promise.reject(e)}var s},o.onEvent=function(e,t){this.emit(e,t)},o.getVideoLevels=function(){if(this.tech)return this.tech.getVideoLevels()},o.play=function(){var e;return null==(e=this.tech)?void 0:e.play()},o.pause=function(){var e;return null==(e=this.tech)?void 0:e.pause()},o.stop=function(){return this.destroy()},o.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;this.tech&&(r?t=r/100*this.tech.duration:n&&(t=this.tech.currentTime+n),this.tech.currentTime=t)},o.seekToLive=function(){var e;return null==(e=this.tech)?void 0:e.seekToLive()},o.setAudioTrack=function(e){this.tech&&(this.tech.audioTrack=e)},o.setTextTrack=function(e){this.tech&&(this.tech.textTrack=e)},o.mute=function(){var e;null==(e=this.tech)||e.mute()},o.unmute=function(){var e;null==(e=this.tech)||e.unmute()},o.reset=function(){this.tech&&(this.tech.destroy(),this.tech=null,this.emit(a.UNREADY))},l(t,[{key:"isPlaying",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isPlaying)&&e}},{key:"isMuted",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isMuted)&&e}},{key:"isLive",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isLive)&&e}},{key:"currentTime",get:function(){var e;return null==(e=this.tech)?void 0:e.currentTime}},{key:"currentLevel",get:function(){if(this.tech)return this.tech.currentLevel},set:function(e){this.tech&&(this.tech.currentLevel=e)}}]),t}(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
2
2
|
/*!*********************************************!*\
|
|
3
3
|
!*** ./node_modules/eventemitter3/index.js ***!
|
|
4
4
|
\*********************************************/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eyevinn/web-player",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"author": "Eyevinn Technology <work@eyevinn.se>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Benjamin Wallberg <benjamin.wallberg@eyevinn.se> (Eyevinn Technology AB)"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"url": "https://github.com/Eyevinn/web-player/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eyevinn/web-player-core": "^0.
|
|
33
|
-
"@eyevinn/web-player-eyevinn-skin": "^0.6.
|
|
32
|
+
"@eyevinn/web-player-core": "^0.8.0",
|
|
33
|
+
"@eyevinn/web-player-eyevinn-skin": "^0.6.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"css-loader": "^4.3.0",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "f4c531b54534e8cb549a227e02e297aef9a78824"
|
|
45
45
|
}
|