bigscreen-player 5.4.4 → 5.5.0
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/esm/{imscsubtitles-5b855995.js → imscsubtitles-26f24b02.js} +1 -1
- package/dist/esm/{legacysubtitles-a4b56c30.js → legacysubtitles-9cf8b751.js} +1 -1
- package/dist/esm/{main-4ce63fbf.js → main-f63b6e0d.js} +107 -84
- package/dist/esm/main.js +1 -1
- package/dist/esm/{msestrategy-32f70ffd.js → msestrategy-d0305f42.js} +27 -18
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromXML, generateISD, renderHTML } from 'smp-imsc';
|
|
2
|
-
import { b as TimeUtils, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-
|
|
2
|
+
import { b as TimeUtils, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-f63b6e0d.js';
|
|
3
3
|
|
|
4
4
|
function IMSCSubtitles (mediaPlayer, autoStart, parentElement, mediaSources, defaultStyleOpts) {
|
|
5
5
|
const SEGMENTS_TO_KEEP = 3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-
|
|
1
|
+
import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-f63b6e0d.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Safely checks if an attribute exists on an element.
|
|
@@ -34,7 +34,9 @@ function PluginData (args) {
|
|
|
34
34
|
this.isInitialPlay = args.isInitialPlay;
|
|
35
35
|
this.cdn = args.cdn;
|
|
36
36
|
this.newCdn = args.newCdn;
|
|
37
|
-
this.timeStamp = new Date()
|
|
37
|
+
this.timeStamp = new Date(),
|
|
38
|
+
this.code = args.code,
|
|
39
|
+
this.message = args.message;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
var PluginEnums = {
|
|
@@ -47,6 +49,14 @@ var PluginEnums = {
|
|
|
47
49
|
TYPE: {
|
|
48
50
|
BUFFERING: 'buffering',
|
|
49
51
|
ERROR: 'error'
|
|
52
|
+
},
|
|
53
|
+
ERROR_CODES: {
|
|
54
|
+
BUFFERING_TIMEOUT: 8,
|
|
55
|
+
MANIFEST: 9
|
|
56
|
+
},
|
|
57
|
+
ERROR_MESSAGES: {
|
|
58
|
+
BUFFERING_TIMEOUT: 'bigscreen-player-buffering-timeout-error',
|
|
59
|
+
MANIFEST: 'bigscreen-player-manifest-error'
|
|
50
60
|
}
|
|
51
61
|
};
|
|
52
62
|
|
|
@@ -982,11 +992,15 @@ function LegacyPlayerAdapter (mediaSources, windowType, playbackElement, isUHD,
|
|
|
982
992
|
publishMediaState(MediaState.ENDED);
|
|
983
993
|
}
|
|
984
994
|
|
|
985
|
-
function onError () {
|
|
995
|
+
function onError (error) {
|
|
986
996
|
if (handleErrorOnExitingSeek && exitingSeek) {
|
|
987
997
|
restartMediaPlayer();
|
|
988
998
|
} else {
|
|
989
|
-
|
|
999
|
+
let mediaError = {
|
|
1000
|
+
code: error.code || 0,
|
|
1001
|
+
message: error.message || 'unknown'
|
|
1002
|
+
};
|
|
1003
|
+
publishError(mediaError);
|
|
990
1004
|
}
|
|
991
1005
|
}
|
|
992
1006
|
|
|
@@ -1024,9 +1038,9 @@ function LegacyPlayerAdapter (mediaSources, windowType, playbackElement, isUHD,
|
|
|
1024
1038
|
}
|
|
1025
1039
|
}
|
|
1026
1040
|
|
|
1027
|
-
function publishError () {
|
|
1041
|
+
function publishError (mediaError) {
|
|
1028
1042
|
if (errorCallback) {
|
|
1029
|
-
errorCallback();
|
|
1043
|
+
errorCallback(mediaError);
|
|
1030
1044
|
}
|
|
1031
1045
|
}
|
|
1032
1046
|
|
|
@@ -2301,8 +2315,9 @@ function Html5 () {
|
|
|
2301
2315
|
}, 1100);
|
|
2302
2316
|
}
|
|
2303
2317
|
|
|
2304
|
-
function reportError (
|
|
2305
|
-
|
|
2318
|
+
function reportError (errorString, mediaError) {
|
|
2319
|
+
DebugTool$1.info('HTML5 Media Player error: ' + errorString);
|
|
2320
|
+
emitEvent(MediaPlayerBase.EVENT.ERROR, mediaError);
|
|
2306
2321
|
}
|
|
2307
2322
|
|
|
2308
2323
|
function toBuffering () {
|
|
@@ -2325,7 +2340,7 @@ function Html5 () {
|
|
|
2325
2340
|
function toError (errorMessage) {
|
|
2326
2341
|
wipe();
|
|
2327
2342
|
state = MediaPlayerBase.STATE.ERROR;
|
|
2328
|
-
reportError();
|
|
2343
|
+
reportError(errorMessage);
|
|
2329
2344
|
}
|
|
2330
2345
|
|
|
2331
2346
|
function isReadyToPlayFrom () {
|
|
@@ -2405,11 +2420,11 @@ function Html5 () {
|
|
|
2405
2420
|
}
|
|
2406
2421
|
|
|
2407
2422
|
function onError () {
|
|
2408
|
-
reportError('Media element error code: ' + mediaElement.error.code);
|
|
2423
|
+
reportError('Media element error code: ' + mediaElement.error.code, {code: mediaElement.error.code, message: mediaElement.error.message });
|
|
2409
2424
|
}
|
|
2410
2425
|
|
|
2411
2426
|
function onSourceError () {
|
|
2412
|
-
reportError();
|
|
2427
|
+
reportError('Media source element error');
|
|
2413
2428
|
}
|
|
2414
2429
|
|
|
2415
2430
|
function onDeviceBuffering () {
|
|
@@ -2700,7 +2715,7 @@ function Html5 () {
|
|
|
2700
2715
|
|
|
2701
2716
|
toStopped();
|
|
2702
2717
|
} else {
|
|
2703
|
-
toError();
|
|
2718
|
+
toError('Cannot set source unless in the \'' + MediaPlayerBase.STATE.EMPTY + '\' state');
|
|
2704
2719
|
}
|
|
2705
2720
|
},
|
|
2706
2721
|
|
|
@@ -2740,7 +2755,7 @@ function Html5 () {
|
|
|
2740
2755
|
break
|
|
2741
2756
|
|
|
2742
2757
|
default:
|
|
2743
|
-
toError();
|
|
2758
|
+
toError('Cannot playFrom while in the \'' + getState() + '\' state');
|
|
2744
2759
|
break
|
|
2745
2760
|
}
|
|
2746
2761
|
},
|
|
@@ -2757,7 +2772,7 @@ function Html5 () {
|
|
|
2757
2772
|
break
|
|
2758
2773
|
|
|
2759
2774
|
default:
|
|
2760
|
-
toError();
|
|
2775
|
+
toError('Cannot beginPlayback while in the \'' + getState() + '\' state');
|
|
2761
2776
|
break
|
|
2762
2777
|
}
|
|
2763
2778
|
},
|
|
@@ -2775,7 +2790,7 @@ function Html5 () {
|
|
|
2775
2790
|
break
|
|
2776
2791
|
|
|
2777
2792
|
default:
|
|
2778
|
-
toError();
|
|
2793
|
+
toError('Cannot beginPlaybackFrom while in the \'' + getState() + '\' state');
|
|
2779
2794
|
break
|
|
2780
2795
|
}
|
|
2781
2796
|
},
|
|
@@ -2801,7 +2816,7 @@ function Html5 () {
|
|
|
2801
2816
|
break
|
|
2802
2817
|
|
|
2803
2818
|
default:
|
|
2804
|
-
toError();
|
|
2819
|
+
toError('Cannot pause while in the \'' + getState() + '\' state');
|
|
2805
2820
|
break
|
|
2806
2821
|
}
|
|
2807
2822
|
},
|
|
@@ -2825,7 +2840,7 @@ function Html5 () {
|
|
|
2825
2840
|
break
|
|
2826
2841
|
|
|
2827
2842
|
default:
|
|
2828
|
-
toError();
|
|
2843
|
+
toError('Cannot resume while in the \'' + getState() + '\' state');
|
|
2829
2844
|
break
|
|
2830
2845
|
}
|
|
2831
2846
|
},
|
|
@@ -2844,7 +2859,7 @@ function Html5 () {
|
|
|
2844
2859
|
break
|
|
2845
2860
|
|
|
2846
2861
|
default:
|
|
2847
|
-
toError();
|
|
2862
|
+
toError('Cannot stop while in the \'' + getState() + '\' state');
|
|
2848
2863
|
break
|
|
2849
2864
|
}
|
|
2850
2865
|
},
|
|
@@ -2860,7 +2875,7 @@ function Html5 () {
|
|
|
2860
2875
|
break
|
|
2861
2876
|
|
|
2862
2877
|
default:
|
|
2863
|
-
toError();
|
|
2878
|
+
toError('Cannot reset while in the \'' + getState() + '\' state');
|
|
2864
2879
|
break
|
|
2865
2880
|
}
|
|
2866
2881
|
},
|
|
@@ -5439,9 +5454,9 @@ function BasicStrategy (mediaSources, windowType, mediaKind, playbackElement, is
|
|
|
5439
5454
|
}
|
|
5440
5455
|
}
|
|
5441
5456
|
|
|
5442
|
-
function publishError
|
|
5457
|
+
function publishError(mediaError) {
|
|
5443
5458
|
if (errorCallback) {
|
|
5444
|
-
errorCallback();
|
|
5459
|
+
errorCallback(mediaError);
|
|
5445
5460
|
}
|
|
5446
5461
|
}
|
|
5447
5462
|
|
|
@@ -5531,7 +5546,11 @@ function BasicStrategy (mediaSources, windowType, mediaKind, playbackElement, is
|
|
|
5531
5546
|
}
|
|
5532
5547
|
|
|
5533
5548
|
function onError (_event) {
|
|
5534
|
-
|
|
5549
|
+
let mediaError = {
|
|
5550
|
+
code: mediaElement && mediaElement.error && mediaElement.error.code || 0,
|
|
5551
|
+
message: mediaElement && mediaElement.error && mediaElement.error.message || 'unknown'
|
|
5552
|
+
};
|
|
5553
|
+
publishError(mediaError);
|
|
5535
5554
|
}
|
|
5536
5555
|
|
|
5537
5556
|
function onLoadedMetadata () {
|
|
@@ -5711,12 +5730,12 @@ function StrategyPicker (windowType, isUHD) {
|
|
|
5711
5730
|
return resolve(NativeStrategy)
|
|
5712
5731
|
}
|
|
5713
5732
|
|
|
5714
|
-
return import('./msestrategy-
|
|
5733
|
+
return import('./msestrategy-d0305f42.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
|
|
5715
5734
|
.catch(() => {
|
|
5716
5735
|
reject({error: 'strategyDynamicLoadError'});
|
|
5717
5736
|
})
|
|
5718
5737
|
} else if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
|
|
5719
|
-
return import('./msestrategy-
|
|
5738
|
+
return import('./msestrategy-d0305f42.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
|
|
5720
5739
|
.catch(() => {
|
|
5721
5740
|
reject({error: 'strategyDynamicLoadError'});
|
|
5722
5741
|
})
|
|
@@ -5851,7 +5870,7 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
5851
5870
|
|
|
5852
5871
|
const onError = () => {
|
|
5853
5872
|
tearDownMediaElement();
|
|
5854
|
-
bubbleFatalError(false);
|
|
5873
|
+
bubbleFatalError(false, {code: PluginEnums.ERROR_CODES.MANIFEST, message: PluginEnums.ERROR_MESSAGES.MANIFEST});
|
|
5855
5874
|
};
|
|
5856
5875
|
|
|
5857
5876
|
mediaSources.refresh(doSeek, onError);
|
|
@@ -5910,9 +5929,9 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
5910
5929
|
publishMediaStateUpdate(undefined, { timeUpdate: true });
|
|
5911
5930
|
}
|
|
5912
5931
|
|
|
5913
|
-
function onError () {
|
|
5932
|
+
function onError (mediaError) {
|
|
5914
5933
|
bubbleBufferingCleared();
|
|
5915
|
-
raiseError();
|
|
5934
|
+
raiseError(mediaError);
|
|
5916
5935
|
}
|
|
5917
5936
|
|
|
5918
5937
|
function startBufferingErrorTimeout () {
|
|
@@ -5920,36 +5939,38 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
5920
5939
|
clearBufferingErrorTimeout();
|
|
5921
5940
|
errorTimeoutID = setTimeout(() => {
|
|
5922
5941
|
bubbleBufferingCleared();
|
|
5923
|
-
attemptCdnFailover(
|
|
5942
|
+
attemptCdnFailover({code: PluginEnums.ERROR_CODES.BUFFERING_TIMEOUT, message: PluginEnums.ERROR_MESSAGES.BUFFERING_TIMEOUT});
|
|
5924
5943
|
}, bufferingTimeout);
|
|
5925
5944
|
}
|
|
5926
5945
|
|
|
5927
|
-
function raiseError () {
|
|
5946
|
+
function raiseError (mediaError) {
|
|
5928
5947
|
clearBufferingErrorTimeout();
|
|
5929
5948
|
publishMediaStateUpdate(MediaState.WAITING);
|
|
5930
|
-
bubbleErrorRaised();
|
|
5931
|
-
startFatalErrorTimeout();
|
|
5949
|
+
bubbleErrorRaised(mediaError);
|
|
5950
|
+
startFatalErrorTimeout(mediaError);
|
|
5932
5951
|
}
|
|
5933
5952
|
|
|
5934
|
-
function startFatalErrorTimeout () {
|
|
5953
|
+
function startFatalErrorTimeout (mediaError) {
|
|
5935
5954
|
if (!fatalErrorTimeout && !fatalError) {
|
|
5936
5955
|
fatalErrorTimeout = setTimeout(() => {
|
|
5937
5956
|
fatalErrorTimeout = null;
|
|
5938
5957
|
fatalError = true;
|
|
5939
|
-
attemptCdnFailover(
|
|
5958
|
+
attemptCdnFailover(mediaError);
|
|
5940
5959
|
}, 5000);
|
|
5941
5960
|
}
|
|
5942
5961
|
}
|
|
5943
5962
|
|
|
5944
|
-
function attemptCdnFailover (
|
|
5963
|
+
function attemptCdnFailover (mediaError) {
|
|
5945
5964
|
const time = getCurrentTime();
|
|
5946
5965
|
const oldWindowStartTime = getWindowStartTime();
|
|
5966
|
+
const bufferingTimeoutError = mediaError.code === PluginEnums.ERROR_CODES.BUFFERING_TIMEOUT;
|
|
5947
5967
|
|
|
5948
5968
|
const failoverParams = {
|
|
5949
|
-
errorMessage: bufferingTimeoutError ? 'bufferingTimeoutError' : 'fatalError',
|
|
5950
5969
|
isBufferingTimeoutError: bufferingTimeoutError,
|
|
5951
5970
|
currentTime: getCurrentTime(),
|
|
5952
|
-
duration: getDuration()
|
|
5971
|
+
duration: getDuration(),
|
|
5972
|
+
code: mediaError.code,
|
|
5973
|
+
message: mediaError.message
|
|
5953
5974
|
};
|
|
5954
5975
|
|
|
5955
5976
|
const doLoadMedia = () => {
|
|
@@ -5961,7 +5982,7 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
5961
5982
|
};
|
|
5962
5983
|
|
|
5963
5984
|
const doErrorCallback = () => {
|
|
5964
|
-
bubbleFatalError(bufferingTimeoutError);
|
|
5985
|
+
bubbleFatalError(bufferingTimeoutError, mediaError);
|
|
5965
5986
|
};
|
|
5966
5987
|
|
|
5967
5988
|
mediaSources.failover(doLoadMedia, doErrorCallback, failoverParams);
|
|
@@ -5994,8 +6015,8 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
5994
6015
|
Plugins.interface.onErrorCleared(evt);
|
|
5995
6016
|
}
|
|
5996
6017
|
|
|
5997
|
-
function bubbleErrorRaised () {
|
|
5998
|
-
const evt = new PluginData({ status: PluginEnums.STATUS.STARTED, stateType: PluginEnums.TYPE.ERROR, isBufferingTimeoutError: false });
|
|
6018
|
+
function bubbleErrorRaised (mediaError) {
|
|
6019
|
+
const evt = new PluginData({ status: PluginEnums.STATUS.STARTED, stateType: PluginEnums.TYPE.ERROR, isBufferingTimeoutError: false, code: mediaError.code, message: mediaError.message });
|
|
5999
6020
|
Plugins.interface.onError(evt);
|
|
6000
6021
|
}
|
|
6001
6022
|
|
|
@@ -6009,20 +6030,30 @@ function PlayerComponent (playbackElement, bigscreenPlayerData, mediaSources, wi
|
|
|
6009
6030
|
Plugins.interface.onBufferingCleared(evt);
|
|
6010
6031
|
}
|
|
6011
6032
|
|
|
6012
|
-
function bubbleFatalError (bufferingTimeoutError) {
|
|
6013
|
-
const evt = new PluginData({ status: PluginEnums.STATUS.FATAL, stateType: PluginEnums.TYPE.ERROR, isBufferingTimeoutError: bufferingTimeoutError });
|
|
6033
|
+
function bubbleFatalError (bufferingTimeoutError, mediaError) {
|
|
6034
|
+
const evt = new PluginData({ status: PluginEnums.STATUS.FATAL, stateType: PluginEnums.TYPE.ERROR, isBufferingTimeoutError: bufferingTimeoutError, code: mediaError.code, message: mediaError.message });
|
|
6014
6035
|
Plugins.interface.onFatalError(evt);
|
|
6015
|
-
publishMediaStateUpdate(MediaState.FATAL_ERROR, { isBufferingTimeoutError: bufferingTimeoutError });
|
|
6036
|
+
publishMediaStateUpdate(MediaState.FATAL_ERROR, { isBufferingTimeoutError: bufferingTimeoutError, code: mediaError.code, message: mediaError.message });
|
|
6016
6037
|
}
|
|
6017
6038
|
|
|
6018
6039
|
function publishMediaStateUpdate (state, opts) {
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6040
|
+
let stateUpdateData = {
|
|
6041
|
+
data: {
|
|
6042
|
+
currentTime: getCurrentTime(),
|
|
6043
|
+
seekableRange: getSeekableRange(),
|
|
6044
|
+
state: state,
|
|
6045
|
+
duration: getDuration()
|
|
6046
|
+
},
|
|
6047
|
+
timeUpdate: opts && opts.timeUpdate,
|
|
6048
|
+
isBufferingTimeoutError: (opts && opts.isBufferingTimeoutError || false),
|
|
6049
|
+
};
|
|
6024
6050
|
|
|
6025
|
-
|
|
6051
|
+
if(opts && opts.code > -1 && opts.message ) {
|
|
6052
|
+
stateUpdateData.code = opts.code;
|
|
6053
|
+
stateUpdateData.message = opts.message;
|
|
6054
|
+
}
|
|
6055
|
+
|
|
6056
|
+
stateUpdateCallback(stateUpdateData);
|
|
6026
6057
|
}
|
|
6027
6058
|
|
|
6028
6059
|
function initialMediaPlay (media, startTime) {
|
|
@@ -6096,7 +6127,7 @@ function CallCallbacks (callbacks, data) {
|
|
|
6096
6127
|
callbacks.forEach((callback) => DeferExceptions(() => callback(data)));
|
|
6097
6128
|
}
|
|
6098
6129
|
|
|
6099
|
-
var version = "5.
|
|
6130
|
+
var version = "5.5.0";
|
|
6100
6131
|
|
|
6101
6132
|
var sourceList;
|
|
6102
6133
|
var source;
|
|
@@ -6292,33 +6323,27 @@ var mockFunctions = {
|
|
|
6292
6323
|
return callback
|
|
6293
6324
|
},
|
|
6294
6325
|
unregisterForTimeUpdates: function (callback) {
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
timeUpdateCallbacks.splice(indexOf, 1);
|
|
6299
|
-
}
|
|
6326
|
+
timeUpdateCallbacks = timeUpdateCallbacks.filter(function (existingCallback) {
|
|
6327
|
+
return callback !== existingCallback
|
|
6328
|
+
});
|
|
6300
6329
|
},
|
|
6301
6330
|
registerForSubtitleChanges: function (callback) {
|
|
6302
6331
|
subtitleCallbacks.push(callback);
|
|
6303
6332
|
return callback
|
|
6304
6333
|
},
|
|
6305
6334
|
unregisterForSubtitleChanges: function (callback) {
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
subtitleCallbacks.splice(indexOf, 1);
|
|
6310
|
-
}
|
|
6335
|
+
subtitleCallbacks = subtitleCallbacks.filter(function (existingCallback) {
|
|
6336
|
+
return callback !== existingCallback
|
|
6337
|
+
});
|
|
6311
6338
|
},
|
|
6312
6339
|
registerForStateChanges: function (callback) {
|
|
6313
6340
|
stateChangeCallbacks.push(callback);
|
|
6314
6341
|
return callback
|
|
6315
6342
|
},
|
|
6316
6343
|
unregisterForStateChanges: function (callback) {
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
stateChangeCallbacks.splice(indexOf, 1);
|
|
6321
|
-
}
|
|
6344
|
+
stateChangeCallbacks = stateChangeCallbacks.filter(function (existingCallback) {
|
|
6345
|
+
return callback !== existingCallback
|
|
6346
|
+
});
|
|
6322
6347
|
},
|
|
6323
6348
|
setCurrentTime: function (time) {
|
|
6324
6349
|
currentTime = time;
|
|
@@ -6962,9 +6987,7 @@ function MediaSources () {
|
|
|
6962
6987
|
}
|
|
6963
6988
|
|
|
6964
6989
|
function isFailoverInfoValid (failoverParams) {
|
|
6965
|
-
const infoValid = typeof failoverParams === 'object' &&
|
|
6966
|
-
typeof failoverParams.errorMessage === 'string' &&
|
|
6967
|
-
typeof failoverParams.isBufferingTimeoutError === 'boolean';
|
|
6990
|
+
const infoValid = typeof failoverParams === 'object' && typeof failoverParams.isBufferingTimeoutError === 'boolean';
|
|
6968
6991
|
|
|
6969
6992
|
if (!infoValid) {
|
|
6970
6993
|
DebugTool$1.error('failoverInfo is not valid');
|
|
@@ -7005,7 +7028,7 @@ function MediaSources () {
|
|
|
7005
7028
|
};
|
|
7006
7029
|
|
|
7007
7030
|
const onManifestLoadError = () => {
|
|
7008
|
-
failover(load, failoverError, {
|
|
7031
|
+
failover(load, failoverError, {isBufferingTimeoutError: false, code: PluginEnums.ERROR_CODES.MANIFEST, message: PluginEnums.ERROR_MESSAGES.MANIFEST });
|
|
7009
7032
|
};
|
|
7010
7033
|
|
|
7011
7034
|
function load () {
|
|
@@ -7115,7 +7138,9 @@ function MediaSources () {
|
|
|
7115
7138
|
stateType: PluginEnums.TYPE.ERROR,
|
|
7116
7139
|
isBufferingTimeoutError: failoverInfo.isBufferingTimeoutError,
|
|
7117
7140
|
cdn: mediaSources[0].cdn,
|
|
7118
|
-
newCdn: mediaSources[1].cdn
|
|
7141
|
+
newCdn: mediaSources[1].cdn,
|
|
7142
|
+
code: failoverInfo.code,
|
|
7143
|
+
message: failoverInfo.message
|
|
7119
7144
|
});
|
|
7120
7145
|
Plugins.interface.onErrorHandled(evt);
|
|
7121
7146
|
}
|
|
@@ -7282,14 +7307,14 @@ function Subtitles (mediaPlayer, autoStart, playbackElement, defaultStyleOpts, m
|
|
|
7282
7307
|
let subtitlesContainer;
|
|
7283
7308
|
|
|
7284
7309
|
if (useLegacySubs) {
|
|
7285
|
-
import('./legacysubtitles-
|
|
7310
|
+
import('./legacysubtitles-9cf8b751.js').then(({default: LegacySubtitles}) => {
|
|
7286
7311
|
subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
|
|
7287
7312
|
callback(subtitlesEnabled);
|
|
7288
7313
|
}).catch(() => {
|
|
7289
7314
|
Plugins.interface.onSubtitlesDynamicLoadError();
|
|
7290
7315
|
});
|
|
7291
7316
|
} else {
|
|
7292
|
-
import('./imscsubtitles-
|
|
7317
|
+
import('./imscsubtitles-26f24b02.js').then(({default: IMSCSubtitles}) => {
|
|
7293
7318
|
subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
|
|
7294
7319
|
callback(subtitlesEnabled);
|
|
7295
7320
|
}).catch(() => {
|
|
@@ -7410,7 +7435,9 @@ function BigscreenPlayer () {
|
|
|
7410
7435
|
if (evt.data.state === MediaState.FATAL_ERROR) {
|
|
7411
7436
|
stateObject = {
|
|
7412
7437
|
state: MediaState.FATAL_ERROR,
|
|
7413
|
-
isBufferingTimeoutError: evt.isBufferingTimeoutError
|
|
7438
|
+
isBufferingTimeoutError: evt.isBufferingTimeoutError,
|
|
7439
|
+
code: evt.code,
|
|
7440
|
+
message: evt.message
|
|
7414
7441
|
};
|
|
7415
7442
|
}
|
|
7416
7443
|
|
|
@@ -7623,10 +7650,9 @@ function BigscreenPlayer () {
|
|
|
7623
7650
|
* @param {Function} callback
|
|
7624
7651
|
*/
|
|
7625
7652
|
unregisterForStateChanges: (callback) => {
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
}
|
|
7653
|
+
stateChangeCallbacks = stateChangeCallbacks.filter(function (existingCallback) {
|
|
7654
|
+
return callback !== existingCallback
|
|
7655
|
+
});
|
|
7630
7656
|
},
|
|
7631
7657
|
|
|
7632
7658
|
/**
|
|
@@ -7645,11 +7671,9 @@ function BigscreenPlayer () {
|
|
|
7645
7671
|
* @param {Function} callback
|
|
7646
7672
|
*/
|
|
7647
7673
|
unregisterForTimeUpdates: (callback) => {
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
timeUpdateCallbacks.splice(indexOf, 1);
|
|
7652
|
-
}
|
|
7674
|
+
timeUpdateCallbacks = timeUpdateCallbacks.filter(function (existingCallback) {
|
|
7675
|
+
return callback !== existingCallback
|
|
7676
|
+
});
|
|
7653
7677
|
},
|
|
7654
7678
|
|
|
7655
7679
|
/**
|
|
@@ -7668,10 +7692,9 @@ function BigscreenPlayer () {
|
|
|
7668
7692
|
* @param {Function} callback
|
|
7669
7693
|
*/
|
|
7670
7694
|
unregisterForSubtitleChanges: (callback) => {
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
}
|
|
7695
|
+
subtitleCallbacks = subtitleCallbacks.filter(function (existingCallback) {
|
|
7696
|
+
return callback !== existingCallback
|
|
7697
|
+
});
|
|
7675
7698
|
},
|
|
7676
7699
|
|
|
7677
7700
|
/**
|
package/dist/esm/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BigscreenPlayer, c as LiveSupport, d as MediaKinds, M as MediaState, f as MockBigscreenPlayer, g as PauseTriggers, h as PlaybackStrategy, i as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-
|
|
1
|
+
export { B as BigscreenPlayer, c as LiveSupport, d as MediaKinds, M as MediaState, f as MockBigscreenPlayer, g as PauseTriggers, h as PlaybackStrategy, i as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-f63b6e0d.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, U as Utils, b as TimeUtils, e as DynamicWindowUtils } from './main-
|
|
1
|
+
import { D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, U as Utils, b as TimeUtils, e as DynamicWindowUtils } from './main-f63b6e0d.js';
|
|
2
2
|
import { MediaPlayer } from 'dashjs/index_mediaplayerOnly';
|
|
3
3
|
|
|
4
4
|
function filter (manifest, representationOptions) {
|
|
@@ -127,6 +127,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
127
127
|
let isEnded = false;
|
|
128
128
|
|
|
129
129
|
let dashMetrics;
|
|
130
|
+
let lastError;
|
|
130
131
|
|
|
131
132
|
let publishedSeekEvent = false;
|
|
132
133
|
let isSeeking = false;
|
|
@@ -145,9 +146,9 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
145
146
|
ERROR: 'error',
|
|
146
147
|
MANIFEST_LOADED: 'manifestLoaded',
|
|
147
148
|
DOWNLOAD_MANIFEST_ERROR_CODE: 25,
|
|
148
|
-
DOWNLOAD_SIDX_ERROR_CODE: 26,
|
|
149
149
|
DOWNLOAD_CONTENT_ERROR_CODE: 27,
|
|
150
150
|
DOWNLOAD_INIT_SEGMENT_ERROR_CODE: 28,
|
|
151
|
+
UNSUPPORTED_CODEC: 30,
|
|
151
152
|
MANIFEST_VALIDITY_CHANGED: 'manifestValidityChanged',
|
|
152
153
|
QUALITY_CHANGE_RENDERED: 'qualityChangeRendered',
|
|
153
154
|
BASE_URL_SELECTED: 'baseUrlSelected',
|
|
@@ -220,31 +221,37 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
if (event.error && event.error.message) {
|
|
223
|
-
DebugTool.info('MSE Error: ' + event.error.message);
|
|
224
|
+
DebugTool.info('MSE Error: ' + event.error.message + ' Code: ' + event.error.code);
|
|
225
|
+
lastError = event.error;
|
|
224
226
|
|
|
225
227
|
// Don't raise an error on fragment download error
|
|
226
|
-
if (event.error.code === DashJSEvents.
|
|
227
|
-
event.error.code === DashJSEvents.DOWNLOAD_CONTENT_ERROR_CODE ||
|
|
228
|
-
event.error.code === DashJSEvents.DOWNLOAD_INIT_SEGMENT_ERROR_CODE) {
|
|
228
|
+
if (event.error.code === DashJSEvents.DOWNLOAD_CONTENT_ERROR_CODE || event.error.code === DashJSEvents.DOWNLOAD_INIT_SEGMENT_ERROR_CODE) {
|
|
229
229
|
return
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
if (event.error.code === DashJSEvents.DOWNLOAD_MANIFEST_ERROR_CODE) {
|
|
233
|
-
manifestDownloadError();
|
|
233
|
+
manifestDownloadError(event.error);
|
|
234
234
|
return
|
|
235
235
|
}
|
|
236
|
+
|
|
237
|
+
// It is possible audio could play back even if the video codec is not supported. Resetting here prevents this.
|
|
238
|
+
if(event.error.code === DashJSEvents.UNSUPPORTED_CODEC) {
|
|
239
|
+
mediaPlayer.reset();
|
|
240
|
+
}
|
|
236
241
|
}
|
|
237
|
-
|
|
242
|
+
|
|
243
|
+
publishError(event.error);
|
|
238
244
|
}
|
|
239
245
|
|
|
240
|
-
function manifestDownloadError (
|
|
241
|
-
const error = () => publishError();
|
|
246
|
+
function manifestDownloadError (mediaError) {
|
|
247
|
+
const error = () => publishError(mediaError);
|
|
242
248
|
|
|
243
249
|
const failoverParams = {
|
|
244
|
-
errorMessage: 'manifest-refresh',
|
|
245
250
|
isBufferingTimeoutError: false,
|
|
246
251
|
currentTime: getCurrentTime(),
|
|
247
|
-
duration: getDuration()
|
|
252
|
+
duration: getDuration(),
|
|
253
|
+
code: mediaError.code,
|
|
254
|
+
message: mediaError.message
|
|
248
255
|
};
|
|
249
256
|
|
|
250
257
|
mediaSources.failover(load, error, failoverParams);
|
|
@@ -341,16 +348,19 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
341
348
|
*/
|
|
342
349
|
function onBaseUrlSelected (event) {
|
|
343
350
|
const failoverInfo = {
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
isBufferingTimeoutError: false,
|
|
352
|
+
code: lastError && lastError.code,
|
|
353
|
+
message: lastError && lastError.message
|
|
346
354
|
};
|
|
347
355
|
|
|
348
356
|
function log () {
|
|
349
357
|
DebugTool.info('BaseUrl selected: ' + event.baseUrl.url);
|
|
358
|
+
lastError = undefined;
|
|
350
359
|
}
|
|
351
360
|
|
|
352
361
|
failoverInfo.serviceLocation = event.baseUrl.serviceLocation;
|
|
353
362
|
mediaSources.failover(log, log, failoverInfo);
|
|
363
|
+
|
|
354
364
|
}
|
|
355
365
|
|
|
356
366
|
function onServiceLocationAvailable (event) {
|
|
@@ -404,9 +414,9 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
404
414
|
}
|
|
405
415
|
}
|
|
406
416
|
|
|
407
|
-
function publishError () {
|
|
417
|
+
function publishError (mediaError) {
|
|
408
418
|
if (errorCallback) {
|
|
409
|
-
errorCallback();
|
|
419
|
+
errorCallback(mediaError);
|
|
410
420
|
}
|
|
411
421
|
}
|
|
412
422
|
|
|
@@ -473,7 +483,6 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
473
483
|
mediaElement.addEventListener('seeking', onBuffering);
|
|
474
484
|
mediaElement.addEventListener('seeked', onSeeked);
|
|
475
485
|
mediaElement.addEventListener('ended', onEnded);
|
|
476
|
-
mediaElement.addEventListener('error', onError);
|
|
477
486
|
mediaPlayer.on(DashJSEvents.ERROR, onError);
|
|
478
487
|
mediaPlayer.on(DashJSEvents.MANIFEST_LOADED, onManifestLoaded);
|
|
479
488
|
mediaPlayer.on(DashJSEvents.STREAM_INITIALIZED, onStreamInitialised);
|
|
@@ -618,7 +627,6 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
618
627
|
mediaElement.removeEventListener('seeking', onBuffering);
|
|
619
628
|
mediaElement.removeEventListener('seeked', onSeeked);
|
|
620
629
|
mediaElement.removeEventListener('ended', onEnded);
|
|
621
|
-
mediaElement.removeEventListener('error', onError);
|
|
622
630
|
mediaPlayer.off(DashJSEvents.ERROR, onError);
|
|
623
631
|
mediaPlayer.off(DashJSEvents.MANIFEST_LOADED, onManifestLoaded);
|
|
624
632
|
mediaPlayer.off(DashJSEvents.MANIFEST_VALIDITY_CHANGED, onManifestValidityChange);
|
|
@@ -632,6 +640,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
632
640
|
|
|
633
641
|
DOMHelpers.safeRemoveElement(mediaElement);
|
|
634
642
|
|
|
643
|
+
lastError = undefined;
|
|
635
644
|
mediaPlayer = undefined;
|
|
636
645
|
mediaElement = undefined;
|
|
637
646
|
eventCallbacks = [];
|