@antmedia/web_player 2.11.2 → 2.11.10

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.
@@ -2,6 +2,21 @@
2
2
 
3
3
  var _commonjsHelpers = require('./_commonjsHelpers-ed042b00.js');
4
4
 
5
+ function _extends$3() {
6
+ _extends$3 = Object.assign ? Object.assign.bind() : function (target) {
7
+ for (var i = 1; i < arguments.length; i++) {
8
+ var source = arguments[i];
9
+ for (var key in source) {
10
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
11
+ target[key] = source[key];
12
+ }
13
+ }
14
+ }
15
+ return target;
16
+ };
17
+ return _extends$3.apply(this, arguments);
18
+ }
19
+
5
20
  var win;
6
21
  if (typeof window !== "undefined") {
7
22
  win = window;
@@ -536,7 +551,7 @@ var safeParseTuple = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(tuple
536
551
 
537
552
  var lib = {exports: {}};
538
553
 
539
- var _extends$3 = {exports: {}};
554
+ var _extends$2 = {exports: {}};
540
555
 
541
556
  (function (module) {
542
557
  function _extends() {
@@ -554,9 +569,9 @@ var _extends$3 = {exports: {}};
554
569
  return _extends.apply(this, arguments);
555
570
  }
556
571
  module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
557
- } (_extends$3));
572
+ } (_extends$2));
558
573
 
559
- var _extendsExports = _extends$3.exports;
574
+ var _extendsExports = _extends$2.exports;
560
575
 
561
576
  var isFunction_1 = isFunction$1;
562
577
  var toString$1 = Object.prototype.toString;
@@ -831,7 +846,7 @@ function getCharset(contentTypeHeader) {
831
846
  var httpHandler = httpResponseHandler;
832
847
 
833
848
  var window$2 = window_1;
834
- var _extends$2 = _extendsExports;
849
+ var _extends$1 = _extendsExports;
835
850
  var isFunction = isFunction_1;
836
851
  var InterceptorsStorage = interceptors;
837
852
  var RetryManager = retry;
@@ -899,7 +914,7 @@ function initParams(uri, options, callback) {
899
914
  };
900
915
  }
901
916
  } else {
902
- params = _extends$2({}, options, {
917
+ params = _extends$1({}, options, {
903
918
  uri: uri
904
919
  });
905
920
  }
@@ -2832,21 +2847,6 @@ if (!window$1.VTTCue) {
2832
2847
  var browserIndexExports = browserIndex.exports;
2833
2848
  var vtt = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(browserIndexExports);
2834
2849
 
2835
- function _extends$1() {
2836
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
2837
- for (var i = 1; i < arguments.length; i++) {
2838
- var source = arguments[i];
2839
- for (var key in source) {
2840
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2841
- target[key] = source[key];
2842
- }
2843
- }
2844
- }
2845
- return target;
2846
- };
2847
- return _extends$1.apply(this, arguments);
2848
- }
2849
-
2850
2850
  var urlToolkit = {exports: {}};
2851
2851
 
2852
2852
  (function (module, exports) {
@@ -3435,7 +3435,7 @@ class ParseStream extends Stream {
3435
3435
  }
3436
3436
  match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);
3437
3437
  if (match) {
3438
- event = _extends$1(parseByterange(match[1]), {
3438
+ event = _extends$3(parseByterange(match[1]), {
3439
3439
  type: 'tag',
3440
3440
  tagType: 'byterange'
3441
3441
  });
@@ -4267,7 +4267,7 @@ class Parser extends Stream {
4267
4267
  if (!currentUri.attributes) {
4268
4268
  currentUri.attributes = {};
4269
4269
  }
4270
- _extends$1(currentUri.attributes, entry.attributes);
4270
+ _extends$3(currentUri.attributes, entry.attributes);
4271
4271
  },
4272
4272
  media() {
4273
4273
  this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
@@ -4518,8 +4518,8 @@ class Parser extends Stream {
4518
4518
  } // if tags with the same ID do not have conflicting attributes, merge them
4519
4519
 
4520
4520
  const dateRangeWithSameId = this.manifest.dateRanges.findIndex(dateRangeToFind => dateRangeToFind.id === dateRange.id);
4521
- this.manifest.dateRanges[dateRangeWithSameId] = _extends$1(this.manifest.dateRanges[dateRangeWithSameId], dateRange);
4522
- dateRangeTags[dateRange.id] = _extends$1(dateRangeTags[dateRange.id], dateRange); // after merging, delete the duplicate dateRange that was added last
4521
+ this.manifest.dateRanges[dateRangeWithSameId] = _extends$3(this.manifest.dateRanges[dateRangeWithSameId], dateRange);
4522
+ dateRangeTags[dateRange.id] = _extends$3(dateRangeTags[dateRange.id], dateRange); // after merging, delete the duplicate dateRange that was added last
4523
4523
 
4524
4524
  this.manifest.dateRanges.pop();
4525
4525
  }
@@ -26359,7 +26359,7 @@ const phonyUri=`placeholder-uri-${i}`;main.playlists[i].uri=phonyUri;}}const aud
26359
26359
  if(!properties.playlists||!properties.playlists.length){// If the manifest is audio only and this media group does not have a uri, check
26360
26360
  // if the media group is located in the main list of playlists. If it is, don't add
26361
26361
  // placeholder properties as it shouldn't be considered an alternate audio track.
26362
- if(audioOnlyMain&&mediaType==='AUDIO'&&!properties.uri){for(let i=0;i<main.playlists.length;i++){const p=main.playlists[i];if(p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===groupKey){return;}}}properties.playlists=[_extends$1({},properties)];}properties.playlists.forEach(function(p,i){const groupId=createGroupID(mediaType,groupKey,labelKey,p);const id=createPlaylistID(i,groupId);if(p.uri){p.resolvedUri=p.resolvedUri||resolveUrl(main.uri,p.uri);}else {// DEPRECATED, this has been added to prevent a breaking change.
26362
+ if(audioOnlyMain&&mediaType==='AUDIO'&&!properties.uri){for(let i=0;i<main.playlists.length;i++){const p=main.playlists[i];if(p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===groupKey){return;}}}properties.playlists=[_extends$3({},properties)];}properties.playlists.forEach(function(p,i){const groupId=createGroupID(mediaType,groupKey,labelKey,p);const id=createPlaylistID(i,groupId);if(p.uri){p.resolvedUri=p.resolvedUri||resolveUrl(main.uri,p.uri);}else {// DEPRECATED, this has been added to prevent a breaking change.
26363
26363
  // previously we only ever had a single media group playlist, so
26364
26364
  // we mark the first playlist uri without prepending the index as we used to
26365
26365
  // ideally we would do all of the playlists the same way.
@@ -26373,7 +26373,7 @@ if(this.offset_!==null){return;}// no segment to process
26373
26373
  if(!segments.length){return;}const[firstSegment]=segments;// no program date time
26374
26374
  if(firstSegment.programDateTime===undefined){return;}// Set offset as ProgramDateTime for the very first segment of the very first playlist load:
26375
26375
  this.offset_=firstSegment.programDateTime/1000;}setPendingDateRanges(dateRanges=[]){if(!dateRanges.length){return;}const[dateRange]=dateRanges;const startTime=dateRange.startDate.getTime();this.trimProcessedDateRanges_(startTime);this.pendingDateRanges_=dateRanges.reduce((map,pendingDateRange)=>{map.set(pendingDateRange.id,pendingDateRange);return map;},new Map());}processDateRange(dateRange){this.pendingDateRanges_.delete(dateRange.id);this.processedDateRanges_.set(dateRange.id,dateRange);}getDateRangesToProcess(){if(this.offset_===null){return [];}const dateRangeClasses={};const dateRangesToProcess=[];this.pendingDateRanges_.forEach((dateRange,id)=>{if(this.processedDateRanges_.has(id)){return;}dateRange.startTime=dateRange.startDate.getTime()/1000-this.offset_;dateRange.processDateRange=()=>this.processDateRange(dateRange);dateRangesToProcess.push(dateRange);if(!dateRange.class){return;}if(dateRangeClasses[dateRange.class]){const length=dateRangeClasses[dateRange.class].push(dateRange);dateRange.classListIndex=length-1;}else {dateRangeClasses[dateRange.class]=[dateRange];dateRange.classListIndex=0;}});for(const dateRange of dateRangesToProcess){const classList=dateRangeClasses[dateRange.class]||[];if(dateRange.endDate){dateRange.endTime=dateRange.endDate.getTime()/1000-this.offset_;}else if(dateRange.endOnNext&&classList[dateRange.classListIndex+1]){dateRange.endTime=classList[dateRange.classListIndex+1].startTime;}else if(dateRange.duration){dateRange.endTime=dateRange.startTime+dateRange.duration;}else if(dateRange.plannedDuration){dateRange.endTime=dateRange.startTime+dateRange.plannedDuration;}else {dateRange.endTime=dateRange.startTime;}}return dateRangesToProcess;}trimProcessedDateRanges_(startTime){const copy=new Map(this.processedDateRanges_);copy.forEach((dateRange,id)=>{if(dateRange.startDate.getTime()<startTime){this.processedDateRanges_.delete(id);}});}}const QUOTA_EXCEEDED_ERR=22;const getStreamingNetworkErrorMetadata=({requestType,request,error,parseFailure})=>{const isBadStatus=request.status<200||request.status>299;const isFailure=request.status>=400&&request.status<=499;const errorMetadata={uri:request.uri,requestType};const isBadStatusOrParseFailure=isBadStatus&&!isFailure||parseFailure;if(error&&isFailure){// copy original error and add to the metadata.
26376
- errorMetadata.error=_extends$1({},error);errorMetadata.errorType=videojs.Error.NetworkRequestFailed;}else if(request.aborted){errorMetadata.errorType=videojs.Error.NetworkRequestAborted;}else if(request.timedout){errorMetadata.erroType=videojs.Error.NetworkRequestTimeout;}else if(isBadStatusOrParseFailure){const errorType=parseFailure?videojs.Error.NetworkBodyParserFailed:videojs.Error.NetworkBadStatus;errorMetadata.errorType=errorType;errorMetadata.status=request.status;errorMetadata.headers=request.headers;}return errorMetadata;};const{EventTarget:EventTarget$1}=videojs;const addLLHLSQueryDirectives=(uri,media)=>{if(media.endList||!media.serverControl){return uri;}const parameters={};if(media.serverControl.canBlockReload){const{preloadSegment}=media;// next msn is a zero based value, length is not.
26376
+ errorMetadata.error=_extends$3({},error);errorMetadata.errorType=videojs.Error.NetworkRequestFailed;}else if(request.aborted){errorMetadata.errorType=videojs.Error.NetworkRequestAborted;}else if(request.timedout){errorMetadata.erroType=videojs.Error.NetworkRequestTimeout;}else if(isBadStatusOrParseFailure){const errorType=parseFailure?videojs.Error.NetworkBodyParserFailed:videojs.Error.NetworkBadStatus;errorMetadata.errorType=errorType;errorMetadata.status=request.status;errorMetadata.headers=request.headers;}return errorMetadata;};const{EventTarget:EventTarget$1}=videojs;const addLLHLSQueryDirectives=(uri,media)=>{if(media.endList||!media.serverControl){return uri;}const parameters={};if(media.serverControl.canBlockReload){const{preloadSegment}=media;// next msn is a zero based value, length is not.
26377
26377
  let nextMSN=media.mediaSequence+media.segments.length;// If preload segment has parts then it is likely
26378
26378
  // that we are going to request a part of that preload segment.
26379
26379
  // the logic below is used to determine that.
@@ -26642,7 +26642,7 @@ main.playlists[playlistId]=playlist;main.playlists[uri]=playlist;this.createClon
26642
26642
  // to the next media type.
26643
26643
  if(!main.mediaGroups[mediaType]||main.mediaGroups[mediaType][id]){return;}for(const groupKey in main.mediaGroups[mediaType]){if(groupKey===baseID){// Create the group.
26644
26644
  main.mediaGroups[mediaType][id]={};}else {// There is no need to iterate over label keys in this case.
26645
- continue;}for(const labelKey in main.mediaGroups[mediaType][groupKey]){const oldMedia=main.mediaGroups[mediaType][groupKey][labelKey];main.mediaGroups[mediaType][id][labelKey]=_extends$1({},oldMedia);const newMedia=main.mediaGroups[mediaType][id][labelKey];// update URIs on the media
26645
+ continue;}for(const labelKey in main.mediaGroups[mediaType][groupKey]){const oldMedia=main.mediaGroups[mediaType][groupKey][labelKey];main.mediaGroups[mediaType][id][labelKey]=_extends$3({},oldMedia);const newMedia=main.mediaGroups[mediaType][id][labelKey];// update URIs on the media
26646
26646
  const newUri=this.createCloneURI_(oldMedia.resolvedUri,clone);newMedia.resolvedUri=newUri;newMedia.uri=newUri;// Reset playlists in the new media group.
26647
26647
  newMedia.playlists=[];// Create new playlists in the newly cloned media group.
26648
26648
  oldMedia.playlists.forEach((p,i)=>{const oldMediaPlaylist=main.playlists[p.id];const group=groupID(mediaType,id,labelKey);const newPlaylistID=createPlaylistID(id,group);// Check to see if it already exists
@@ -29455,7 +29455,7 @@ data:buffer,// To recreate the original typed-array, we need information
29455
29455
  // about what portion of the ArrayBuffer it was a view into
29456
29456
  byteOffset,byteLength:bytes.byteLength},[buffer]);}if(isEndOfTimeline){transmuxer.postMessage({action:'endTimeline'});}// even if we didn't push any bytes, we have to make sure we flush in case we reached
29457
29457
  // the end of the segment
29458
- transmuxer.postMessage({action:'flush'});};const dequeue=transmuxer=>{transmuxer.currentTransmux=null;if(transmuxer.transmuxQueue.length){transmuxer.currentTransmux=transmuxer.transmuxQueue.shift();if(typeof transmuxer.currentTransmux==='function'){transmuxer.currentTransmux();}else {processTransmux(transmuxer.currentTransmux);}}};const processAction=(transmuxer,action)=>{transmuxer.postMessage({action});dequeue(transmuxer);};const enqueueAction=(action,transmuxer)=>{if(!transmuxer.currentTransmux){transmuxer.currentTransmux=action;processAction(transmuxer,action);return;}transmuxer.transmuxQueue.push(processAction.bind(null,transmuxer,action));};const reset=transmuxer=>{enqueueAction('reset',transmuxer);};const endTimeline=transmuxer=>{enqueueAction('endTimeline',transmuxer);};const transmux=options=>{if(!options.transmuxer.currentTransmux){options.transmuxer.currentTransmux=options;processTransmux(options);return;}options.transmuxer.transmuxQueue.push(options);};const createTransmuxer=options=>{const transmuxer=new TransmuxWorker();transmuxer.currentTransmux=null;transmuxer.transmuxQueue=[];const term=transmuxer.terminate;transmuxer.terminate=()=>{transmuxer.currentTransmux=null;transmuxer.transmuxQueue.length=0;return term.call(transmuxer);};transmuxer.postMessage({action:'init',options});return transmuxer;};var segmentTransmuxer={reset,endTimeline,transmux,createTransmuxer};const workerCallback=function(options){const transmuxer=options.transmuxer;const endAction=options.endAction||options.action;const callback=options.callback;const message=_extends$1({},options,{endAction:null,transmuxer:null,callback:null});const listenForEndEvent=event=>{if(event.data.action!==endAction){return;}transmuxer.removeEventListener('message',listenForEndEvent);// transfer ownership of bytes back to us.
29458
+ transmuxer.postMessage({action:'flush'});};const dequeue=transmuxer=>{transmuxer.currentTransmux=null;if(transmuxer.transmuxQueue.length){transmuxer.currentTransmux=transmuxer.transmuxQueue.shift();if(typeof transmuxer.currentTransmux==='function'){transmuxer.currentTransmux();}else {processTransmux(transmuxer.currentTransmux);}}};const processAction=(transmuxer,action)=>{transmuxer.postMessage({action});dequeue(transmuxer);};const enqueueAction=(action,transmuxer)=>{if(!transmuxer.currentTransmux){transmuxer.currentTransmux=action;processAction(transmuxer,action);return;}transmuxer.transmuxQueue.push(processAction.bind(null,transmuxer,action));};const reset=transmuxer=>{enqueueAction('reset',transmuxer);};const endTimeline=transmuxer=>{enqueueAction('endTimeline',transmuxer);};const transmux=options=>{if(!options.transmuxer.currentTransmux){options.transmuxer.currentTransmux=options;processTransmux(options);return;}options.transmuxer.transmuxQueue.push(options);};const createTransmuxer=options=>{const transmuxer=new TransmuxWorker();transmuxer.currentTransmux=null;transmuxer.transmuxQueue=[];const term=transmuxer.terminate;transmuxer.terminate=()=>{transmuxer.currentTransmux=null;transmuxer.transmuxQueue.length=0;return term.call(transmuxer);};transmuxer.postMessage({action:'init',options});return transmuxer;};var segmentTransmuxer={reset,endTimeline,transmux,createTransmuxer};const workerCallback=function(options){const transmuxer=options.transmuxer;const endAction=options.endAction||options.action;const callback=options.callback;const message=_extends$3({},options,{endAction:null,transmuxer:null,callback:null});const listenForEndEvent=event=>{if(event.data.action!==endAction){return;}transmuxer.removeEventListener('message',listenForEndEvent);// transfer ownership of bytes back to us.
29459
29459
  if(event.data.data){event.data.data=new Uint8Array(event.data.data,options.byteOffset||0,options.byteLength||event.data.data.byteLength);if(options.data){options.data=event.data.data;}}callback(event.data);};transmuxer.addEventListener('message',listenForEndEvent);if(options.data){const isArrayBuffer=options.data instanceof ArrayBuffer;message.byteOffset=isArrayBuffer?0:options.data.byteOffset;message.byteLength=options.data.byteLength;const transfers=[isArrayBuffer?options.data:options.data.buffer];transmuxer.postMessage(message,transfers);}else {transmuxer.postMessage(message);}};const REQUEST_ERRORS={FAILURE:2,TIMEOUT:-101,ABORTED:-102};/**
29460
29460
  * Abort all requests
29461
29461
  *
@@ -30339,14 +30339,14 @@ this.cacheEncryptionKeys_=settings.cacheEncryptionKeys;this.keyCache_={};this.de
30339
30339
  // between a time in the display time and a segment index within
30340
30340
  // a playlist
30341
30341
  this.syncController_=settings.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger('syncinfoupdate');this.syncController_.on('syncinfoupdate',this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener('sourceopen',()=>{if(!this.isEndOfStream_()){this.ended_=false;}});// ...for determining the fetch location
30342
- this.fetchAtBuffer_=false;this.logger_=logger(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,'state',{get(){return this.state_;},set(newState){if(newState!==this.state_){this.logger_(`${this.state_} -> ${newState}`);this.state_=newState;this.trigger('statechange');}}});this.sourceUpdater_.on('ready',()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_();}});this.sourceUpdater_.on('codecschange',metadata=>{this.trigger(_extends$1({type:'codecschange'},metadata));});// Only the main loader needs to listen for pending timeline changes, as the main
30342
+ this.fetchAtBuffer_=false;this.logger_=logger(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,'state',{get(){return this.state_;},set(newState){if(newState!==this.state_){this.logger_(`${this.state_} -> ${newState}`);this.state_=newState;this.trigger('statechange');}}});this.sourceUpdater_.on('ready',()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_();}});this.sourceUpdater_.on('codecschange',metadata=>{this.trigger(_extends$3({type:'codecschange'},metadata));});// Only the main loader needs to listen for pending timeline changes, as the main
30343
30343
  // loader should wait for audio to be ready to change its timeline so that both main
30344
30344
  // and audio timelines change together. For more details, see the
30345
30345
  // shouldWaitForTimelineChange function.
30346
30346
  if(this.loaderType_==='main'){this.timelineChangeController_.on('pendingtimelinechange',()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_();}});}// The main loader only listens on pending timeline changes, but the audio loader,
30347
30347
  // since its loads follow main, needs to listen on timeline changes. For more details,
30348
30348
  // see the shouldWaitForTimelineChange function.
30349
- if(this.loaderType_==='audio'){this.timelineChangeController_.on('timelinechange',metadata=>{this.trigger(_extends$1({type:'timelinechange'},metadata));if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_();}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_();}});}}/**
30349
+ if(this.loaderType_==='audio'){this.timelineChangeController_.on('timelinechange',metadata=>{this.trigger(_extends$3({type:'timelinechange'},metadata));if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_();}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_();}});}}/**
30350
30350
  * TODO: Current sync controller consists of many hls-specific strategies
30351
30351
  * media sequence sync is also hls-specific, and we would like to be protocol-agnostic on this level
30352
30352
  * this should be a part of the sync-controller and sync controller should expect different strategy list based on the protocol.
@@ -30837,7 +30837,7 @@ segment[timingInfoProperty].baseMediaDecodeTime=segmentTimingInfo.baseMediaDecod
30837
30837
  * @private
30838
30838
  */loadSegment_(segmentInfo){this.state='WAITING';this.pendingSegment_=segmentInfo;this.trimBackBuffer_(segmentInfo);if(typeof segmentInfo.timestampOffset==='number'){if(this.transmuxer_){this.transmuxer_.postMessage({action:'clearAllMp4Captions'});}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{// regenerate the audioAppendStart, timestampOffset, etc as they
30839
30839
  // may have changed since this function was added to the queue.
30840
- const options=_extends$1({},segmentInfo,{forceTimestampOffset:true});_extends$1(segmentInfo,this.generateSegmentInfo_(options));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(segmentInfo);});return;}this.updateTransmuxerAndRequestSegment_(segmentInfo);}updateTransmuxerAndRequestSegment_(segmentInfo){// We'll update the source buffer's timestamp offset once we have transmuxed data, but
30840
+ const options=_extends$3({},segmentInfo,{forceTimestampOffset:true});_extends$3(segmentInfo,this.generateSegmentInfo_(options));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(segmentInfo);});return;}this.updateTransmuxerAndRequestSegment_(segmentInfo);}updateTransmuxerAndRequestSegment_(segmentInfo){// We'll update the source buffer's timestamp offset once we have transmuxed data, but
30841
30841
  // the transmuxer still needs to be updated before then.
30842
30842
  //
30843
30843
  // Even though keepOriginalTimestamps is set to true for the transmuxer, timestamp
@@ -32379,7 +32379,7 @@ if(updatedPlaylist.lastExcludeReason_==='playlist-unchanged'){return;}const play
32379
32379
  // safe live point).
32380
32380
  this.excludePlaylist({error:{message:'Playlist no longer updating.',reason:'playlist-unchanged'}});// useful for monitoring QoS
32381
32381
  this.tech_.trigger('playliststuck');}});this.mainPlaylistLoader_.on('renditiondisabled',()=>{this.tech_.trigger({type:'usage',name:'vhs-rendition-disabled'});});this.mainPlaylistLoader_.on('renditionenabled',()=>{this.tech_.trigger({type:'usage',name:'vhs-rendition-enabled'});});const playlistLoaderEvents=['manifestrequeststart','manifestrequestcomplete','manifestparsestart','manifestparsecomplete','playlistrequeststart','playlistrequestcomplete','playlistparsestart','playlistparsecomplete','renditiondisabled','renditionenabled'];playlistLoaderEvents.forEach(eventName=>{this.mainPlaylistLoader_.on(eventName,metadata=>{// trigger directly on the player to ensure early events are fired.
32382
- this.player_.trigger(_extends$1({},metadata));});});}/**
32382
+ this.player_.trigger(_extends$3({},metadata));});});}/**
32383
32383
  * Given an updated media playlist (whether it was loaded for the first time, or
32384
32384
  * refreshed for live playlists), update any relevant properties and state to reflect
32385
32385
  * changes in the media that should be accounted for (e.g., cues and duration).
@@ -32413,7 +32413,7 @@ this.mainSegmentLoader_.load();}});// `progress` events are not reliable enough
32413
32413
  // based ABR.
32414
32414
  if(!this.bufferBasedABR){this.mainSegmentLoader_.on('progress',()=>{this.trigger('progress');});}this.mainSegmentLoader_.on('error',()=>{const error=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:error.playlist,error});});this.mainSegmentLoader_.on('appenderror',()=>{this.error=this.mainSegmentLoader_.error_;this.trigger('error');});this.mainSegmentLoader_.on('syncinfoupdate',()=>{this.onSyncInfoUpdate_();});this.mainSegmentLoader_.on('timestampoffset',()=>{this.tech_.trigger({type:'usage',name:'vhs-timestamp-offset'});});this.audioSegmentLoader_.on('syncinfoupdate',()=>{this.onSyncInfoUpdate_();});this.audioSegmentLoader_.on('appenderror',()=>{this.error=this.audioSegmentLoader_.error_;this.trigger('error');});this.mainSegmentLoader_.on('ended',()=>{this.logger_('main segment loader ended');this.onEndOfStream();});this.mainSegmentLoader_.on('earlyabort',event=>{// never try to early abort with the new ABR algorithm
32415
32415
  if(this.bufferBasedABR){return;}this.delegateLoaders_('all',['abort']);this.excludePlaylist({error:{message:'Aborted early because there isn\'t enough bandwidth to complete '+'the request without rebuffering.'},playlistExclusionDuration:ABORT_EARLY_EXCLUSION_SECONDS});});const updateCodecs=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_();}const codecs=this.getCodecsOrExclude_();// no codecs means that the playlist was excluded
32416
- if(!codecs){return;}this.sourceUpdater_.addOrChangeSourceBuffers(codecs);};this.mainSegmentLoader_.on('trackinfo',updateCodecs);this.audioSegmentLoader_.on('trackinfo',updateCodecs);this.mainSegmentLoader_.on('fmp4',()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:'usage',name:'vhs-fmp4'});this.triggeredFmp4Usage=true;}});this.audioSegmentLoader_.on('fmp4',()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:'usage',name:'vhs-fmp4'});this.triggeredFmp4Usage=true;}});this.audioSegmentLoader_.on('ended',()=>{this.logger_('audioSegmentLoader ended');this.onEndOfStream();});const segmentLoaderEvents=['segmentselected','segmentloadstart','segmentloaded','segmentkeyloadstart','segmentkeyloadcomplete','segmentdecryptionstart','segmentdecryptioncomplete','segmenttransmuxingstart','segmenttransmuxingcomplete','segmenttransmuxingtrackinfoavailable','segmenttransmuxingtiminginfoavailable','segmentappendstart','appendsdone','bandwidthupdated','timelinechange','codecschange'];segmentLoaderEvents.forEach(eventName=>{this.mainSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$1({},metadata));});this.audioSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$1({},metadata));});this.subtitleSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$1({},metadata));});});}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded);}/**
32416
+ if(!codecs){return;}this.sourceUpdater_.addOrChangeSourceBuffers(codecs);};this.mainSegmentLoader_.on('trackinfo',updateCodecs);this.audioSegmentLoader_.on('trackinfo',updateCodecs);this.mainSegmentLoader_.on('fmp4',()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:'usage',name:'vhs-fmp4'});this.triggeredFmp4Usage=true;}});this.audioSegmentLoader_.on('fmp4',()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:'usage',name:'vhs-fmp4'});this.triggeredFmp4Usage=true;}});this.audioSegmentLoader_.on('ended',()=>{this.logger_('audioSegmentLoader ended');this.onEndOfStream();});const segmentLoaderEvents=['segmentselected','segmentloadstart','segmentloaded','segmentkeyloadstart','segmentkeyloadcomplete','segmentdecryptionstart','segmentdecryptioncomplete','segmenttransmuxingstart','segmenttransmuxingcomplete','segmenttransmuxingtrackinfoavailable','segmenttransmuxingtiminginfoavailable','segmentappendstart','appendsdone','bandwidthupdated','timelinechange','codecschange'];segmentLoaderEvents.forEach(eventName=>{this.mainSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$3({},metadata));});this.audioSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$3({},metadata));});this.subtitleSegmentLoader_.on(eventName,metadata=>{this.player_.trigger(_extends$3({},metadata));});});}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded);}/**
32417
32417
  * Call load on our SegmentLoaders
32418
32418
  */load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load();}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load();}}/**
32419
32419
  * Re-tune playback quality level for the current player
@@ -32709,7 +32709,7 @@ this.tech_.one('canplay',()=>{this.contentSteeringController_.requestSteeringMan
32709
32709
  * Reset the content steering controller and re-init.
32710
32710
  */resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_();}/**
32711
32711
  * Attaches the listeners for content steering.
32712
- */attachContentSteeringListeners_(){this.contentSteeringController_.on('content-steering',this.excludeThenChangePathway_.bind(this));const contentSteeringEvents=['contentsteeringloadstart','contentsteeringloadcomplete','contentsteeringparsed'];contentSteeringEvents.forEach(eventName=>{this.contentSteeringController_.on(eventName,metadata=>{this.trigger(_extends$1({},metadata));});});if(this.sourceType_==='dash'){this.mainPlaylistLoader_.on('loadedplaylist',()=>{const main=this.main();// check if steering tag or pathways changed.
32712
+ */attachContentSteeringListeners_(){this.contentSteeringController_.on('content-steering',this.excludeThenChangePathway_.bind(this));const contentSteeringEvents=['contentsteeringloadstart','contentsteeringloadcomplete','contentsteeringparsed'];contentSteeringEvents.forEach(eventName=>{this.contentSteeringController_.on(eventName,metadata=>{this.trigger(_extends$3({},metadata));});});if(this.sourceType_==='dash'){this.mainPlaylistLoader_.on('loadedplaylist',()=>{const main=this.main();// check if steering tag or pathways changed.
32713
32713
  const didDashTagChange=this.contentSteeringController_.didDASHTagChange(main.uri,main.contentSteering);const didPathwaysChange=()=>{const availablePathways=this.contentSteeringController_.getAvailablePathways();const newPathways=[];for(const playlist of main.playlists){const serviceLocation=playlist.attributes.serviceLocation;if(serviceLocation){newPathways.push(serviceLocation);if(!availablePathways.has(serviceLocation)){return true;}}}// If we have no new serviceLocations and previously had availablePathways
32714
32714
  if(!newPathways.length&&availablePathways.size){return true;}return false;};if(didDashTagChange||didPathwaysChange()){this.resetContentSteeringController_();}});}}/**
32715
32715
  * Simple exclude and change playlist logic for content steering.
@@ -33313,7 +33313,7 @@ seekToProgramTime(programTime,callback,pauseAfterSeek=true,retryCount=2){return
33313
33313
  */this.xhr.offResponse=callback=>{removeOnResponseHook(this.xhr,callback);};// Trigger an event on the player to notify the user that vhs is ready to set xhr hooks.
33314
33314
  // This allows hooks to be set before the source is set to vhs when handleSource is called.
33315
33315
  this.player_.trigger('xhr-hooks-ready');}attachStreamingEventListeners_(){const playlistControllerEvents=['seekablerangeschanged','bufferedrangeschanged','contentsteeringloadstart','contentsteeringloadcomplete','contentsteeringparsed'];const playbackWatcher=['gapjumped','playedrangeschanged'];// re-emit streaming events and payloads on the player.
33316
- playlistControllerEvents.forEach(eventName=>{this.playlistController_.on(eventName,metadata=>{this.player_.trigger(_extends$1({},metadata));});});playbackWatcher.forEach(eventName=>{this.playbackWatcher_.on(eventName,metadata=>{this.player_.trigger(_extends$1({},metadata));});});}}/**
33316
+ playlistControllerEvents.forEach(eventName=>{this.playlistController_.on(eventName,metadata=>{this.player_.trigger(_extends$3({},metadata));});});playbackWatcher.forEach(eventName=>{this.playbackWatcher_.on(eventName,metadata=>{this.player_.trigger(_extends$3({},metadata));});});}}/**
33317
33317
  * The Source Handler object, which informs video.js what additional
33318
33318
  * MIME types are supported and sets up playback. It is registered
33319
33319
  * automatically to the appropriate tech based on the capabilities of
@@ -33327,4 +33327,11 @@ playlistControllerEvents.forEach(eventName=>{this.playlistController_.on(eventNa
33327
33327
  */const supportsNativeMediaSources=()=>{return browserSupportsCodec('avc1.4d400d,mp4a.40.2');};// register source handlers with the appropriate techs
33328
33328
  if(supportsNativeMediaSources()){videojs.getTech('Html5').registerSourceHandler(VhsSourceHandler,0);}videojs.VhsHandler=VhsHandler;videojs.VhsSourceHandler=VhsSourceHandler;videojs.Vhs=Vhs;if(!videojs.use){videojs.registerComponent('Vhs',Vhs);}videojs.options.vhs=videojs.options.vhs||{};if(!videojs.getPlugin||!videojs.getPlugin('reloadSourceOnError')){videojs.registerPlugin('reloadSourceOnError',reloadSourceOnError);}
33329
33329
 
33330
- exports.default = videojs;
33330
+ var video_es = /*#__PURE__*/Object.freeze({
33331
+ __proto__: null,
33332
+ default: videojs
33333
+ });
33334
+
33335
+ exports._extends = _extends$3;
33336
+ exports.video_es = video_es;
33337
+ exports.videojs = videojs;
@@ -1,18 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var video_es = require('./video.es-df9af03d.js');
3
+ var video_es = require('./video.es-474303e7.js');
4
4
  require('./_commonjsHelpers-ed042b00.js');
5
5
 
6
- function _extends() {
7
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
8
- for (var e = 1; e < arguments.length; e++) {
9
- var t = arguments[e];
10
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
11
- }
12
- return n;
13
- }, _extends.apply(null, arguments);
14
- }
15
-
16
6
  /*! @name @antmedia/videojs-webrtc-plugin @version 1.3.1 @license MIT */
17
7
  const ANT_CALLBACKS = {
18
8
  INITIALIZED: 'initialized',
@@ -26,8 +16,8 @@ const ANT_CALLBACKS = {
26
16
  DATACHANNEL_NOT_OPEN: 'data_channel_not_open',
27
17
  NEW_TRACK_AVAILABLE: 'newTrackAvailable'
28
18
  };
29
- const MenuItem = video_es.default.getComponent('MenuItem');
30
- const Component = video_es.default.getComponent('Component');
19
+ const MenuItem = video_es.videojs.getComponent('MenuItem');
20
+ const Component = video_es.videojs.getComponent('Component');
31
21
  class ResolutionMenuItem extends MenuItem {
32
22
  constructor(player, options) {
33
23
  options.selectable = true;
@@ -39,13 +29,13 @@ class ResolutionMenuItem extends MenuItem {
39
29
  }
40
30
  }
41
31
  Component.registerComponent('ResolutionMenuItem', ResolutionMenuItem);
42
- const MenuButton = video_es.default.getComponent('MenuButton');
32
+ const MenuButton = video_es.videojs.getComponent('MenuButton');
43
33
  class ResolutionMenuButton extends MenuButton {
44
34
  constructor(player, options) {
45
35
  super(player, options);
46
36
  }
47
37
  createEl() {
48
- return video_es.default.dom.createEl('div', {
38
+ return video_es.videojs.dom.createEl('div', {
49
39
  className: 'vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button'
50
40
  });
51
41
  }
@@ -1497,7 +1487,7 @@ class MediaManager {
1497
1487
  var videoConstraint = {
1498
1488
  'facingMode': facingMode
1499
1489
  };
1500
- this.mediaConstraints.video = _extends({}, this.mediaConstraints.video, videoConstraint);
1490
+ this.mediaConstraints.video = video_es._extends({}, this.mediaConstraints.video, videoConstraint);
1501
1491
  this.publishMode = "camera";
1502
1492
  Logger$3.debug("Media constraints video property = " + this.mediaConstraints.video);
1503
1493
  return this.setVideoCameraSource(streamId, {
@@ -1774,14 +1764,14 @@ class MediaManager {
1774
1764
  if (newConstraints.audio === undefined && newConstraints.video === undefined) {
1775
1765
  //if audio or video field is not defined, assume that it's a video constraint
1776
1766
  constraints.video = newConstraints;
1777
- this.mediaConstraints.video = _extends({}, this.mediaConstraints.video, constraints.video);
1767
+ this.mediaConstraints.video = video_es._extends({}, this.mediaConstraints.video, constraints.video);
1778
1768
  } else if (newConstraints.video !== undefined) {
1779
1769
  constraints.video = newConstraints.video;
1780
- this.mediaConstraints.video = _extends({}, this.mediaConstraints.video, constraints.video);
1770
+ this.mediaConstraints.video = video_es._extends({}, this.mediaConstraints.video, constraints.video);
1781
1771
  }
1782
1772
  if (newConstraints.audio !== undefined) {
1783
1773
  constraints.audio = newConstraints.audio;
1784
- this.mediaConstraints.audio = _extends({}, this.mediaConstraints.audio, constraints.audio);
1774
+ this.mediaConstraints.audio = video_es._extends({}, this.mediaConstraints.audio, constraints.audio);
1785
1775
  }
1786
1776
  var promise = null;
1787
1777
  if (constraints.video !== undefined) {
@@ -6541,7 +6531,7 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
6541
6531
  r.h = 0;
6542
6532
  });
6543
6533
  };
6544
- }(g))), k.graphOptionXref && (h = _extends({}, {
6534
+ }(g))), k.graphOptionXref && (h = video_es._extends({}, {
6545
6535
  calculatorName: "",
6546
6536
  calculatorIndex: 0
6547
6537
  }, k.graphOptionXref, {
@@ -6690,7 +6680,7 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
6690
6680
  B = q.data;
6691
6681
  J = B.addNormalizedLandmark;
6692
6682
  I = w;
6693
- u = _extends({}, u, {
6683
+ u = video_es._extends({}, u, {
6694
6684
  visibility: u.visibility ? u.visibility : 0
6695
6685
  });
6696
6686
  var C = new Lc();
@@ -6713,7 +6703,7 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
6713
6703
  m = k.stream;
6714
6704
  switch (k.type) {
6715
6705
  case "video":
6716
- e.pushTexture2d(_extends({}, l, {
6706
+ e.pushTexture2d(video_es._extends({}, l, {
6717
6707
  stream: m,
6718
6708
  timestamp: d
6719
6709
  }));
@@ -7416,7 +7406,7 @@ class WebRTCHandler {
7416
7406
  * Subscriber code
7417
7407
  */
7418
7408
  constructor(source, tech, options) {
7419
- this.player = video_es.default(options.playerId);
7409
+ this.player = video_es.videojs(options.playerId);
7420
7410
  if (!this.player.hasOwnProperty('sendDataViaWebRTC')) {
7421
7411
  Object.defineProperty(this.player, 'sendDataViaWebRTC', {
7422
7412
  value: data => {
@@ -7435,8 +7425,8 @@ class WebRTCHandler {
7435
7425
  this.player.el().removeChild(this.player.spinner);
7436
7426
  }
7437
7427
  });
7438
- video_es.default.registerComponent('ResolutionMenuButton', ResolutionMenuButton);
7439
- video_es.default.registerComponent('ResolutionMenuItem', ResolutionMenuItem);
7428
+ video_es.videojs.registerComponent('ResolutionMenuButton', ResolutionMenuButton);
7429
+ video_es.videojs.registerComponent('ResolutionMenuItem', ResolutionMenuItem);
7440
7430
  }
7441
7431
  /**
7442
7432
  * Initiate WebRTCAdaptor.
@@ -7446,7 +7436,7 @@ class WebRTCHandler {
7446
7436
  *
7447
7437
  */
7448
7438
  initiateWebRTCAdaptor(source, options) {
7449
- this.options = video_es.default.mergeOptions(defaults, options);
7439
+ this.options = video_es.videojs.mergeOptions(defaults, options);
7450
7440
  this.source = source;
7451
7441
  if (typeof source.iceServers === 'object') {
7452
7442
  this.source.pcConfig = {
@@ -7540,7 +7530,7 @@ class WebRTCHandler {
7540
7530
  return;
7541
7531
  }
7542
7532
  // some of the possible errors, NotFoundError, SecurityError,PermissionDeniedError
7543
- const ModalDialog = video_es.default.getComponent('ModalDialog');
7533
+ const ModalDialog = video_es.videojs.getComponent('ModalDialog');
7544
7534
  if (this.errorModal) {
7545
7535
  this.errorModal.close();
7546
7536
  }
@@ -7561,8 +7551,8 @@ class WebRTCHandler {
7561
7551
  if (this.source.pcConfig) {
7562
7552
  /* eslint-disable camelcase */
7563
7553
  const peerconnection_config = {};
7564
- _extends(peerconnection_config, this.source.pcConfig);
7565
- _extends(config, {
7554
+ video_es._extends(peerconnection_config, this.source.pcConfig);
7555
+ video_es._extends(config, {
7566
7556
  peerconnection_config
7567
7557
  });
7568
7558
  }
@@ -7669,12 +7659,12 @@ const webRTCSourceHandler = {
7669
7659
  name: 'videojs-webrtc-plugin',
7670
7660
  VERSION: '1.3.1',
7671
7661
  canHandleSource(srcObj, options = {}) {
7672
- const localOptions = video_es.default.mergeOptions(video_es.default.options, options);
7662
+ const localOptions = video_es.videojs.mergeOptions(video_es.videojs.options, options);
7673
7663
  localOptions.source = srcObj.src;
7674
7664
  return webRTCSourceHandler.canPlayType(srcObj.type, localOptions);
7675
7665
  },
7676
7666
  handleSource(source, tech, options = {}) {
7677
- const localOptions = video_es.default.mergeOptions(video_es.default.options, options);
7667
+ const localOptions = video_es.videojs.mergeOptions(video_es.videojs.options, options);
7678
7668
 
7679
7669
  // setting the src already dispose the component, no need to dispose it again
7680
7670
  tech.webrtc = new WebRTCHandler(source, tech, localOptions);
@@ -7692,7 +7682,7 @@ const webRTCSourceHandler = {
7692
7682
  };
7693
7683
 
7694
7684
  // register source handlers with the appropriate techs
7695
- video_es.default.getTech('Html5').registerSourceHandler(webRTCSourceHandler, 0);
7685
+ video_es.videojs.getTech('Html5').registerSourceHandler(webRTCSourceHandler, 0);
7696
7686
  var plugin = {
7697
7687
  WebRTCHandler,
7698
7688
  webRTCSourceHandler
@@ -711,7 +711,7 @@ class WebPlayer {
711
711
  var styleElement = this.dom.createElement('style');
712
712
  styleElement.textContent = css.default.toString(); // Assuming css module exports a string
713
713
  this.dom.head.appendChild(styleElement);
714
- return Promise.resolve().then(function () { return require('./videojs-webrtc-plugin.es-ee6d0333.js'); }).then(videojsWebrtcPluginLocal => {
714
+ return Promise.resolve().then(function () { return require('./videojs-webrtc-plugin.es-e643c42a.js'); }).then(videojsWebrtcPluginLocal => {
715
715
  Logger_1.info("videojs-webrtc-plugin is loaded");
716
716
  });
717
717
  });
@@ -732,12 +732,12 @@ class WebPlayer {
732
732
  styleElement.textContent = css.default.toString(); // Assuming css module exports a string
733
733
  this.dom.head.appendChild(styleElement);
734
734
  }).then(() => {
735
- return Promise.resolve().then(function () { return require('./video.es-df9af03d.js'); });
735
+ return Promise.resolve().then(function () { return require('./video.es-474303e7.js'); }).then(function (n) { return n.video_es; });
736
736
  }).then(videojs => {
737
737
  window.videojs = videojs.default;
738
738
  this.videojsLoaded = true;
739
739
  }).then(() => {
740
- return Promise.resolve().then(function () { return require('./plugin-bec9dc4a.js'); });
740
+ return Promise.resolve().then(function () { return require('./plugin-1270024e.js'); });
741
741
  }).then(() => {
742
742
  return this.loadWebRTCComponents();
743
743
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antmedia/web_player",
3
- "version": "2.11.2",
3
+ "version": "2.11.10",
4
4
  "description": "Ant Media Server Player that can play WebRTC, HLS, DASH",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/es/index.js",
@@ -1,3 +0,0 @@
1
- var videojsWebrtcPlugin = "/*! @name @antmedia/videojs-webrtc-plugin @version 1.3.0 @license MIT */\n.vjs-custom-spinner{position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);left:50%;width:80px;height:80px}.vjs-custom-spinner:after{content:\" \";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid #fff;border-color:#fff transparent;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}";
2
-
3
- export { videojsWebrtcPlugin as default };