bigscreen-player 5.4.6 → 5.5.2
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-0036237b.js → imscsubtitles-77b97c49.js} +1 -1
- package/dist/esm/{legacysubtitles-f2e0a377.js → legacysubtitles-e57b714b.js} +1 -1
- package/dist/esm/{main-8135ab41.js → main-0a969f9e.js} +88 -55
- package/dist/esm/main.js +1 -1
- package/dist/esm/{msestrategy-3396edaa.js → msestrategy-5a02d016.js} +41 -34
- 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-0a969f9e.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-0a969f9e.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Safely checks if an attribute exists on an element.
|
|
@@ -35,6 +35,8 @@ function PluginData (args) {
|
|
|
35
35
|
this.cdn = args.cdn;
|
|
36
36
|
this.newCdn = args.newCdn;
|
|
37
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-5a02d016.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-5a02d016.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
|
+
};
|
|
6050
|
+
|
|
6051
|
+
if (opts && opts.code > -1 && opts.message) {
|
|
6052
|
+
stateUpdateData.code = opts.code;
|
|
6053
|
+
stateUpdateData.message = opts.message;
|
|
6054
|
+
}
|
|
6024
6055
|
|
|
6025
|
-
stateUpdateCallback(
|
|
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.2";
|
|
6100
6131
|
|
|
6101
6132
|
var sourceList;
|
|
6102
6133
|
var source;
|
|
@@ -6956,9 +6987,7 @@ function MediaSources () {
|
|
|
6956
6987
|
}
|
|
6957
6988
|
|
|
6958
6989
|
function isFailoverInfoValid (failoverParams) {
|
|
6959
|
-
const infoValid = typeof failoverParams === 'object' &&
|
|
6960
|
-
typeof failoverParams.errorMessage === 'string' &&
|
|
6961
|
-
typeof failoverParams.isBufferingTimeoutError === 'boolean';
|
|
6990
|
+
const infoValid = typeof failoverParams === 'object' && typeof failoverParams.isBufferingTimeoutError === 'boolean';
|
|
6962
6991
|
|
|
6963
6992
|
if (!infoValid) {
|
|
6964
6993
|
DebugTool$1.error('failoverInfo is not valid');
|
|
@@ -6999,7 +7028,7 @@ function MediaSources () {
|
|
|
6999
7028
|
};
|
|
7000
7029
|
|
|
7001
7030
|
const onManifestLoadError = () => {
|
|
7002
|
-
failover(load, failoverError, {
|
|
7031
|
+
failover(load, failoverError, { isBufferingTimeoutError: false, code: PluginEnums.ERROR_CODES.MANIFEST, message: PluginEnums.ERROR_MESSAGES.MANIFEST });
|
|
7003
7032
|
};
|
|
7004
7033
|
|
|
7005
7034
|
function load () {
|
|
@@ -7109,7 +7138,9 @@ function MediaSources () {
|
|
|
7109
7138
|
stateType: PluginEnums.TYPE.ERROR,
|
|
7110
7139
|
isBufferingTimeoutError: failoverInfo.isBufferingTimeoutError,
|
|
7111
7140
|
cdn: mediaSources[0].cdn,
|
|
7112
|
-
newCdn: mediaSources[1].cdn
|
|
7141
|
+
newCdn: mediaSources[1].cdn,
|
|
7142
|
+
code: failoverInfo.code,
|
|
7143
|
+
message: failoverInfo.message
|
|
7113
7144
|
});
|
|
7114
7145
|
Plugins.interface.onErrorHandled(evt);
|
|
7115
7146
|
}
|
|
@@ -7276,14 +7307,14 @@ function Subtitles (mediaPlayer, autoStart, playbackElement, defaultStyleOpts, m
|
|
|
7276
7307
|
let subtitlesContainer;
|
|
7277
7308
|
|
|
7278
7309
|
if (useLegacySubs) {
|
|
7279
|
-
import('./legacysubtitles-
|
|
7310
|
+
import('./legacysubtitles-e57b714b.js').then(({default: LegacySubtitles}) => {
|
|
7280
7311
|
subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
|
|
7281
7312
|
callback(subtitlesEnabled);
|
|
7282
7313
|
}).catch(() => {
|
|
7283
7314
|
Plugins.interface.onSubtitlesDynamicLoadError();
|
|
7284
7315
|
});
|
|
7285
7316
|
} else {
|
|
7286
|
-
import('./imscsubtitles-
|
|
7317
|
+
import('./imscsubtitles-77b97c49.js').then(({default: IMSCSubtitles}) => {
|
|
7287
7318
|
subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
|
|
7288
7319
|
callback(subtitlesEnabled);
|
|
7289
7320
|
}).catch(() => {
|
|
@@ -7404,7 +7435,9 @@ function BigscreenPlayer () {
|
|
|
7404
7435
|
if (evt.data.state === MediaState.FATAL_ERROR) {
|
|
7405
7436
|
stateObject = {
|
|
7406
7437
|
state: MediaState.FATAL_ERROR,
|
|
7407
|
-
isBufferingTimeoutError: evt.isBufferingTimeoutError
|
|
7438
|
+
isBufferingTimeoutError: evt.isBufferingTimeoutError,
|
|
7439
|
+
code: evt.code,
|
|
7440
|
+
message: evt.message
|
|
7408
7441
|
};
|
|
7409
7442
|
}
|
|
7410
7443
|
|
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-0a969f9e.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,
|
|
1
|
+
import { U as Utils, D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, b as TimeUtils, e as DynamicWindowUtils } from './main-0a969f9e.js';
|
|
2
2
|
import { MediaPlayer } from 'dashjs/index_mediaplayerOnly';
|
|
3
3
|
|
|
4
4
|
function filter (manifest, representationOptions) {
|
|
@@ -111,8 +111,6 @@ var ManifestModifier = {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUHD, customPlayerSettings) {
|
|
114
|
-
const LIVE_DELAY_SECONDS = 1.1;
|
|
115
|
-
|
|
116
114
|
let mediaPlayer;
|
|
117
115
|
let mediaElement;
|
|
118
116
|
|
|
@@ -127,6 +125,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
127
125
|
let isEnded = false;
|
|
128
126
|
|
|
129
127
|
let dashMetrics;
|
|
128
|
+
let lastError;
|
|
130
129
|
|
|
131
130
|
let publishedSeekEvent = false;
|
|
132
131
|
let isSeeking = false;
|
|
@@ -140,14 +139,26 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
140
139
|
}
|
|
141
140
|
};
|
|
142
141
|
|
|
142
|
+
let playerSettings = Utils.merge({
|
|
143
|
+
debug: {
|
|
144
|
+
logLevel: 2
|
|
145
|
+
},
|
|
146
|
+
streaming: {
|
|
147
|
+
liveDelay: 1.1,
|
|
148
|
+
bufferToKeep: 4,
|
|
149
|
+
bufferTimeAtTopQuality: 12,
|
|
150
|
+
bufferTimeAtTopQualityLongForm: 15
|
|
151
|
+
}
|
|
152
|
+
}, customPlayerSettings);
|
|
153
|
+
|
|
143
154
|
const DashJSEvents = {
|
|
144
155
|
LOG: 'log',
|
|
145
156
|
ERROR: 'error',
|
|
146
157
|
MANIFEST_LOADED: 'manifestLoaded',
|
|
147
158
|
DOWNLOAD_MANIFEST_ERROR_CODE: 25,
|
|
148
|
-
DOWNLOAD_SIDX_ERROR_CODE: 26,
|
|
149
159
|
DOWNLOAD_CONTENT_ERROR_CODE: 27,
|
|
150
160
|
DOWNLOAD_INIT_SEGMENT_ERROR_CODE: 28,
|
|
161
|
+
UNSUPPORTED_CODEC: 30,
|
|
151
162
|
MANIFEST_VALIDITY_CHANGED: 'manifestValidityChanged',
|
|
152
163
|
QUALITY_CHANGE_RENDERED: 'qualityChangeRendered',
|
|
153
164
|
BASE_URL_SELECTED: 'baseUrlSelected',
|
|
@@ -220,31 +231,37 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
220
231
|
}
|
|
221
232
|
|
|
222
233
|
if (event.error && event.error.message) {
|
|
223
|
-
DebugTool.info('MSE Error: ' + event.error.message);
|
|
234
|
+
DebugTool.info('MSE Error: ' + event.error.message + ' Code: ' + event.error.code);
|
|
235
|
+
lastError = event.error;
|
|
224
236
|
|
|
225
237
|
// 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) {
|
|
238
|
+
if (event.error.code === DashJSEvents.DOWNLOAD_CONTENT_ERROR_CODE || event.error.code === DashJSEvents.DOWNLOAD_INIT_SEGMENT_ERROR_CODE) {
|
|
229
239
|
return
|
|
230
240
|
}
|
|
231
241
|
|
|
232
242
|
if (event.error.code === DashJSEvents.DOWNLOAD_MANIFEST_ERROR_CODE) {
|
|
233
|
-
manifestDownloadError();
|
|
243
|
+
manifestDownloadError(event.error);
|
|
234
244
|
return
|
|
235
245
|
}
|
|
246
|
+
|
|
247
|
+
// It is possible audio could play back even if the video codec is not supported. Resetting here prevents this.
|
|
248
|
+
if (event.error.code === DashJSEvents.UNSUPPORTED_CODEC) {
|
|
249
|
+
mediaPlayer.reset();
|
|
250
|
+
}
|
|
236
251
|
}
|
|
237
|
-
|
|
252
|
+
|
|
253
|
+
publishError(event.error);
|
|
238
254
|
}
|
|
239
255
|
|
|
240
|
-
function manifestDownloadError (
|
|
241
|
-
const error = () => publishError();
|
|
256
|
+
function manifestDownloadError (mediaError) {
|
|
257
|
+
const error = () => publishError(mediaError);
|
|
242
258
|
|
|
243
259
|
const failoverParams = {
|
|
244
|
-
errorMessage: 'manifest-refresh',
|
|
245
260
|
isBufferingTimeoutError: false,
|
|
246
261
|
currentTime: getCurrentTime(),
|
|
247
|
-
duration: getDuration()
|
|
262
|
+
duration: getDuration(),
|
|
263
|
+
code: mediaError.code,
|
|
264
|
+
message: mediaError.message
|
|
248
265
|
};
|
|
249
266
|
|
|
250
267
|
mediaSources.failover(load, error, failoverParams);
|
|
@@ -341,12 +358,14 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
341
358
|
*/
|
|
342
359
|
function onBaseUrlSelected (event) {
|
|
343
360
|
const failoverInfo = {
|
|
344
|
-
|
|
345
|
-
|
|
361
|
+
isBufferingTimeoutError: false,
|
|
362
|
+
code: lastError && lastError.code,
|
|
363
|
+
message: lastError && lastError.message
|
|
346
364
|
};
|
|
347
365
|
|
|
348
366
|
function log () {
|
|
349
367
|
DebugTool.info('BaseUrl selected: ' + event.baseUrl.url);
|
|
368
|
+
lastError = undefined;
|
|
350
369
|
}
|
|
351
370
|
|
|
352
371
|
failoverInfo.serviceLocation = event.baseUrl.serviceLocation;
|
|
@@ -404,9 +423,9 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
404
423
|
}
|
|
405
424
|
}
|
|
406
425
|
|
|
407
|
-
function publishError () {
|
|
426
|
+
function publishError (mediaError) {
|
|
408
427
|
if (errorCallback) {
|
|
409
|
-
errorCallback();
|
|
428
|
+
errorCallback(mediaError);
|
|
410
429
|
}
|
|
411
430
|
}
|
|
412
431
|
|
|
@@ -415,7 +434,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
415
434
|
}
|
|
416
435
|
|
|
417
436
|
function getClampedTime (time, range) {
|
|
418
|
-
return Math.min(Math.max(time, range.start), range.end -
|
|
437
|
+
return Math.min(Math.max(time, range.start), range.end - playerSettings.streaming.liveDelay)
|
|
419
438
|
}
|
|
420
439
|
|
|
421
440
|
function load (mimeType, playbackTime) {
|
|
@@ -445,17 +464,6 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
445
464
|
|
|
446
465
|
function setUpMediaPlayer (playbackTime) {
|
|
447
466
|
mediaPlayer = MediaPlayer().create();
|
|
448
|
-
const playerSettings = Utils.merge({
|
|
449
|
-
debug: {
|
|
450
|
-
logLevel: 2
|
|
451
|
-
},
|
|
452
|
-
streaming: {
|
|
453
|
-
liveDelay: LIVE_DELAY_SECONDS,
|
|
454
|
-
bufferToKeep: 4,
|
|
455
|
-
bufferTimeAtTopQuality: 12,
|
|
456
|
-
bufferTimeAtTopQualityLongForm: 15
|
|
457
|
-
}
|
|
458
|
-
}, customPlayerSettings);
|
|
459
467
|
mediaPlayer.updateSettings(playerSettings);
|
|
460
468
|
mediaPlayer.initialize(mediaElement, null, true);
|
|
461
469
|
modifySource(playbackTime);
|
|
@@ -473,7 +481,6 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
473
481
|
mediaElement.addEventListener('seeking', onBuffering);
|
|
474
482
|
mediaElement.addEventListener('seeked', onSeeked);
|
|
475
483
|
mediaElement.addEventListener('ended', onEnded);
|
|
476
|
-
mediaElement.addEventListener('error', onError);
|
|
477
484
|
mediaPlayer.on(DashJSEvents.ERROR, onError);
|
|
478
485
|
mediaPlayer.on(DashJSEvents.MANIFEST_LOADED, onManifestLoaded);
|
|
479
486
|
mediaPlayer.on(DashJSEvents.STREAM_INITIALIZED, onStreamInitialised);
|
|
@@ -518,7 +525,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
518
525
|
if (dvrInfo) {
|
|
519
526
|
return {
|
|
520
527
|
start: dvrInfo.range.start - timeCorrection,
|
|
521
|
-
end: dvrInfo.range.end - timeCorrection
|
|
528
|
+
end: dvrInfo.range.end - timeCorrection - playerSettings.streaming.liveDelay
|
|
522
529
|
}
|
|
523
530
|
}
|
|
524
531
|
}
|
|
@@ -553,7 +560,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
553
560
|
|
|
554
561
|
function calculateSeekOffset (time) {
|
|
555
562
|
function getClampedTimeForLive (time) {
|
|
556
|
-
return Math.min(Math.max(time, 0), mediaPlayer.getDVRWindowSize() -
|
|
563
|
+
return Math.min(Math.max(time, 0), mediaPlayer.getDVRWindowSize() - playerSettings.streaming.liveDelay)
|
|
557
564
|
}
|
|
558
565
|
|
|
559
566
|
if (windowType === WindowTypes.SLIDING) {
|
|
@@ -618,7 +625,6 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
618
625
|
mediaElement.removeEventListener('seeking', onBuffering);
|
|
619
626
|
mediaElement.removeEventListener('seeked', onSeeked);
|
|
620
627
|
mediaElement.removeEventListener('ended', onEnded);
|
|
621
|
-
mediaElement.removeEventListener('error', onError);
|
|
622
628
|
mediaPlayer.off(DashJSEvents.ERROR, onError);
|
|
623
629
|
mediaPlayer.off(DashJSEvents.MANIFEST_LOADED, onManifestLoaded);
|
|
624
630
|
mediaPlayer.off(DashJSEvents.MANIFEST_VALIDITY_CHANGED, onManifestValidityChange);
|
|
@@ -632,6 +638,7 @@ function MSEStrategy (mediaSources, windowType, mediaKind, playbackElement, isUH
|
|
|
632
638
|
|
|
633
639
|
DOMHelpers.safeRemoveElement(mediaElement);
|
|
634
640
|
|
|
641
|
+
lastError = undefined;
|
|
635
642
|
mediaPlayer = undefined;
|
|
636
643
|
mediaElement = undefined;
|
|
637
644
|
eventCallbacks = [];
|