@gcorevideo/player 2.12.1 → 2.12.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/index.js +42 -66
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +10 -15
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/internal.types.d.ts +1 -12
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback.types.d.ts +10 -0
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/dash-playback/DashPlayback.d.ts +1 -0
- package/lib/plugins/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/plugins/dash-playback/DashPlayback.js +16 -13
- package/lib/plugins/hls-playback/HlsPlayback.d.ts +3 -4
- package/lib/plugins/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/plugins/hls-playback/HlsPlayback.js +15 -37
- package/lib/utils/mediaSources.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Player.ts +12 -23
- package/src/index.ts +0 -1
- package/src/internal.types.ts +1 -14
- package/src/playback.types.ts +18 -7
- package/src/plugins/dash-playback/DashPlayback.ts +16 -16
- package/src/plugins/hls-playback/HlsPlayback.ts +19 -40
- package/src/utils/mediaSources.ts +30 -20
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -12517,36 +12517,39 @@ class DashPlayback extends HTML5Video {
|
|
|
12517
12517
|
};
|
|
12518
12518
|
_onDASHJSSError = (event) => {
|
|
12519
12519
|
trace(`${T$2} _onDASHJSSError`, { event });
|
|
12520
|
-
// TODO figure out what's for
|
|
12521
12520
|
this._stopTimeUpdateTimer();
|
|
12522
12521
|
const e = event.error;
|
|
12523
12522
|
switch (e.code) {
|
|
12524
12523
|
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE:
|
|
12525
12524
|
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE:
|
|
12526
12525
|
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_MANIFEST_CODE:
|
|
12527
|
-
|
|
12526
|
+
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE:
|
|
12527
|
+
this.triggerError({
|
|
12528
12528
|
code: PlaybackErrorCode.MediaSourceUnavailable,
|
|
12529
12529
|
message: e.message,
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
})
|
|
12530
|
+
description: e.message,
|
|
12531
|
+
level: PlayerError.Levels.FATAL,
|
|
12532
|
+
});
|
|
12533
12533
|
break;
|
|
12534
12534
|
// TODO more cases
|
|
12535
12535
|
default:
|
|
12536
|
-
this.
|
|
12536
|
+
this.triggerError({
|
|
12537
12537
|
code: PlaybackErrorCode.Generic,
|
|
12538
12538
|
message: e.message,
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
})
|
|
12539
|
+
description: e.message,
|
|
12540
|
+
level: PlayerError.Levels.FATAL,
|
|
12541
|
+
});
|
|
12542
12542
|
}
|
|
12543
|
+
};
|
|
12544
|
+
triggerError(error) {
|
|
12545
|
+
trace(`${T$2} triggerError`, { error });
|
|
12546
|
+
this.trigger(Events$1.PLAYBACK_ERROR, error);
|
|
12543
12547
|
// only reset the dash player in 10ms async, so that the rest of the
|
|
12544
12548
|
// calling function finishes
|
|
12545
12549
|
setTimeout(() => {
|
|
12546
|
-
|
|
12547
|
-
this._dash.reset();
|
|
12550
|
+
this.stop();
|
|
12548
12551
|
}, 10);
|
|
12549
|
-
}
|
|
12552
|
+
}
|
|
12550
12553
|
_onTimeUpdate() {
|
|
12551
12554
|
if (this.startChangeQuality) {
|
|
12552
12555
|
return;
|
|
@@ -41667,9 +41670,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41667
41670
|
else {
|
|
41668
41671
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
41669
41672
|
error.level = PlayerError.Levels.FATAL;
|
|
41670
|
-
|
|
41671
|
-
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
41672
|
-
this.stop();
|
|
41673
|
+
this.triggerError(error);
|
|
41673
41674
|
}
|
|
41674
41675
|
}
|
|
41675
41676
|
// this playback manages the src on the video element itself
|
|
@@ -41751,12 +41752,11 @@ class HlsPlayback extends HTML5Video {
|
|
|
41751
41752
|
}
|
|
41752
41753
|
_onHLSJSError(evt, data) {
|
|
41753
41754
|
const error = {
|
|
41754
|
-
// code: `${data.type}_${data.details}`,
|
|
41755
41755
|
code: PlaybackErrorCode.Generic,
|
|
41756
|
-
description: `${this.name} error: type: ${data.type}, details: ${data.details}`,
|
|
41757
|
-
|
|
41756
|
+
description: `${this.name} error: type: ${data.type}, details: ${data.details} fatal: ${data.fatal}`,
|
|
41757
|
+
level: data.fatal ? PlayerError.Levels.FATAL : PlayerError.Levels.WARN,
|
|
41758
|
+
message: `${this.name} error: type: ${data.type}, details: ${data.details}`,
|
|
41758
41759
|
};
|
|
41759
|
-
let formattedError;
|
|
41760
41760
|
if (data.response) {
|
|
41761
41761
|
error.description += `, response: ${JSON.stringify(data.response)}`;
|
|
41762
41762
|
}
|
|
@@ -41780,18 +41780,8 @@ class HlsPlayback extends HTML5Video {
|
|
|
41780
41780
|
evt,
|
|
41781
41781
|
data,
|
|
41782
41782
|
});
|
|
41783
|
-
error.code =
|
|
41784
|
-
|
|
41785
|
-
Hls.ErrorDetails.MANIFEST_LOAD_TIMEOUT,
|
|
41786
|
-
Hls.ErrorDetails.MANIFEST_PARSING_ERROR
|
|
41787
|
-
].includes(data.details)
|
|
41788
|
-
? PlaybackErrorCode.MediaSourceUnavailable
|
|
41789
|
-
: PlaybackErrorCode.QualityLevelUnavailable;
|
|
41790
|
-
formattedError = this.createError(error, {
|
|
41791
|
-
useCodePrefix: false,
|
|
41792
|
-
});
|
|
41793
|
-
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
41794
|
-
this.stop();
|
|
41783
|
+
error.code = PlaybackErrorCode.MediaSourceUnavailable;
|
|
41784
|
+
this.triggerError(error);
|
|
41795
41785
|
break;
|
|
41796
41786
|
default:
|
|
41797
41787
|
Log.warn('hlsjs: trying to recover from network error.', {
|
|
@@ -41799,8 +41789,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41799
41789
|
data,
|
|
41800
41790
|
});
|
|
41801
41791
|
error.level = PlayerError.Levels.WARN;
|
|
41802
|
-
|
|
41803
|
-
this._hls.startLoad();
|
|
41792
|
+
this._hls?.startLoad();
|
|
41804
41793
|
break;
|
|
41805
41794
|
}
|
|
41806
41795
|
break;
|
|
@@ -41814,22 +41803,14 @@ class HlsPlayback extends HTML5Video {
|
|
|
41814
41803
|
break;
|
|
41815
41804
|
default:
|
|
41816
41805
|
Log.error('hlsjs: could not recover from error.', { evt, data });
|
|
41817
|
-
|
|
41818
|
-
useCodePrefix: false,
|
|
41819
|
-
});
|
|
41820
|
-
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
41821
|
-
this.stop();
|
|
41806
|
+
this.triggerError(error);
|
|
41822
41807
|
break;
|
|
41823
41808
|
}
|
|
41824
41809
|
}
|
|
41825
41810
|
else {
|
|
41826
41811
|
Log.error('hlsjs: could not recover from error after maximum number of attempts.', { evt, data });
|
|
41827
41812
|
// TODO
|
|
41828
|
-
|
|
41829
|
-
useCodePrefix: false,
|
|
41830
|
-
});
|
|
41831
|
-
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
41832
|
-
this.stop();
|
|
41813
|
+
this.triggerError(error);
|
|
41833
41814
|
}
|
|
41834
41815
|
}
|
|
41835
41816
|
else {
|
|
@@ -41840,14 +41821,9 @@ class HlsPlayback extends HTML5Video {
|
|
|
41840
41821
|
if (this.options.playback.triggerFatalErrorOnResourceDenied &&
|
|
41841
41822
|
this._keyIsDenied(data)) {
|
|
41842
41823
|
Log.error('hlsjs: could not load decrypt key.', { evt, data });
|
|
41843
|
-
|
|
41844
|
-
useCodePrefix: false,
|
|
41845
|
-
});
|
|
41846
|
-
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
41847
|
-
this.stop();
|
|
41824
|
+
this.triggerError(error);
|
|
41848
41825
|
return;
|
|
41849
41826
|
}
|
|
41850
|
-
error.level = PlayerError.Levels.WARN;
|
|
41851
41827
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
41852
41828
|
}
|
|
41853
41829
|
}
|
|
@@ -42154,6 +42130,11 @@ class HlsPlayback extends HTML5Video {
|
|
|
42154
42130
|
isSeekEnabled() {
|
|
42155
42131
|
return this._playbackType === Playback.VOD || this.dvrEnabled;
|
|
42156
42132
|
}
|
|
42133
|
+
triggerError(error) {
|
|
42134
|
+
trace(`${T$1} triggerError`, { error });
|
|
42135
|
+
this.trigger(Events$1.PLAYBACK_ERROR, error);
|
|
42136
|
+
this.stop();
|
|
42137
|
+
}
|
|
42157
42138
|
}
|
|
42158
42139
|
HlsPlayback.canPlay = function (resource, mimeType) {
|
|
42159
42140
|
const resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|
|
@@ -42247,9 +42228,6 @@ class Player {
|
|
|
42247
42228
|
rootNode = null;
|
|
42248
42229
|
tuneInTimerId = null;
|
|
42249
42230
|
tunedIn = false;
|
|
42250
|
-
// private sourcesList: PlayerMediaSourceDesc[] = []
|
|
42251
|
-
// private currentSourceIndex = 0
|
|
42252
|
-
// private sourcesDelay: Record<string, number> = {}
|
|
42253
42231
|
constructor(config) {
|
|
42254
42232
|
this.setConfig(config);
|
|
42255
42233
|
}
|
|
@@ -42290,9 +42268,6 @@ class Player {
|
|
|
42290
42268
|
if (this.config.debug === 'all' || this.config.debug === 'clappr') {
|
|
42291
42269
|
Log.setLevel(0);
|
|
42292
42270
|
}
|
|
42293
|
-
trace(`${T} init`, {
|
|
42294
|
-
// TODO selected options
|
|
42295
|
-
});
|
|
42296
42271
|
this.configurePlaybacks();
|
|
42297
42272
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42298
42273
|
const { core, container } = Loader.registeredPlugins;
|
|
@@ -42533,17 +42508,17 @@ class Player {
|
|
|
42533
42508
|
},
|
|
42534
42509
|
};
|
|
42535
42510
|
buildCoreOptions(rootNode) {
|
|
42536
|
-
this.buildMediaSourcesList();
|
|
42537
|
-
const source =
|
|
42538
|
-
|
|
42539
|
-
|
|
42540
|
-
}
|
|
42511
|
+
const sources = this.buildMediaSourcesList();
|
|
42512
|
+
const source = sources[0];
|
|
42513
|
+
trace(`${T} buildCoreOptions`, {
|
|
42514
|
+
source
|
|
42515
|
+
});
|
|
42541
42516
|
this.rootNode = rootNode;
|
|
42542
42517
|
const coreOptions = {
|
|
42543
42518
|
...this.config, // plugin settings
|
|
42544
42519
|
allowUserInteraction: true,
|
|
42545
42520
|
autoPlay: false,
|
|
42546
|
-
dash: this.config.dash,
|
|
42521
|
+
dash: this.config.dash, // TODO move this to the playback section
|
|
42547
42522
|
debug: this.config.debug || 'none',
|
|
42548
42523
|
events: this.events,
|
|
42549
42524
|
height: rootNode.clientHeight,
|
|
@@ -42563,7 +42538,7 @@ class Player {
|
|
|
42563
42538
|
playbackType: this.config.playbackType,
|
|
42564
42539
|
width: rootNode.clientWidth,
|
|
42565
42540
|
source: source ? unwrapSource(source) : undefined,
|
|
42566
|
-
sources
|
|
42541
|
+
sources, // prevent Clappr from loading all sources simultaneously
|
|
42567
42542
|
strings: this.config.strings,
|
|
42568
42543
|
};
|
|
42569
42544
|
return coreOptions;
|
|
@@ -42572,8 +42547,9 @@ class Player {
|
|
|
42572
42547
|
registerPlaybacks();
|
|
42573
42548
|
}
|
|
42574
42549
|
buildMediaSourcesList() {
|
|
42575
|
-
return buildMediaSourcesList(
|
|
42576
|
-
|
|
42550
|
+
return buildMediaSourcesList(
|
|
42551
|
+
// TODO ensure unsupported sources are filtered out
|
|
42552
|
+
this.config.sources.map((s) => wrapSource(s)), this.config.priorityTransport);
|
|
42577
42553
|
}
|
|
42578
42554
|
bindContainerEventListeners(player) {
|
|
42579
42555
|
trace(`${T} bindContainerEventListeners`, {
|
|
@@ -42592,12 +42568,12 @@ class Player {
|
|
|
42592
42568
|
}
|
|
42593
42569
|
}
|
|
42594
42570
|
|
|
42595
|
-
var version$1 = "2.12.
|
|
42571
|
+
var version$1 = "2.12.2";
|
|
42596
42572
|
|
|
42597
42573
|
var packages = {
|
|
42598
42574
|
"": {
|
|
42599
42575
|
name: "@gcorevideo/player",
|
|
42600
|
-
version: "2.12.
|
|
42576
|
+
version: "2.12.2",
|
|
42601
42577
|
license: "Apache-2.0",
|
|
42602
42578
|
dependencies: {
|
|
42603
42579
|
"@clappr/core": "^0.11.3",
|
package/lib/Player.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAQtD;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI,MAAM,IAAI,CAAA;AAelE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,CAAA;AAI3D;;;;;;;GAOG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAgC;IAE9C,OAAO,CAAC,OAAO,CAAkB;IAEjC,OAAO,CAAC,MAAM,CAA4B;IAE1C,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,QAAQ,CAA2B;IAE3C,OAAO,CAAC,aAAa,CAA6C;IAElE,OAAO,CAAC,OAAO,CAAQ;gBAEX,MAAM,EAAE,YAAY;IAIhC;;;;OAIG;IACH,EAAE,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAIlE;;;;OAIG;IACH,GAAG,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAInE;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAIvC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI;IAqB1C;;OAEG;IACH,OAAO;IAgBP;;;OAGG;IACH,cAAc,IAAI,MAAM;IAOxB;;;OAGG;IACH,WAAW,IAAI,MAAM;IAOrB;;OAEG;IACH,IAAI;IAIJ;;OAEG;IACH,MAAM;IAIN;;OAEG;IACH,KAAK;IAIL;;OAEG;IACH,IAAI;IAIJ;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAIjD;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB;;OAEG;IACH,IAAI;IAIJ;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY;IAI1C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,YAAY;IAI5C,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,UAAU;YAqBJ,MAAM;IAwEpB,OAAO,CAAC,MAAM,CAiDb;IAED,OAAO,CAAC,gBAAgB;IAuCxB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,2BAA2B;CAcpC"}
|
package/lib/Player.js
CHANGED
|
@@ -32,9 +32,6 @@ export class Player {
|
|
|
32
32
|
rootNode = null;
|
|
33
33
|
tuneInTimerId = null;
|
|
34
34
|
tunedIn = false;
|
|
35
|
-
// private sourcesList: PlayerMediaSourceDesc[] = []
|
|
36
|
-
// private currentSourceIndex = 0
|
|
37
|
-
// private sourcesDelay: Record<string, number> = {}
|
|
38
35
|
constructor(config) {
|
|
39
36
|
this.setConfig(config);
|
|
40
37
|
}
|
|
@@ -75,9 +72,6 @@ export class Player {
|
|
|
75
72
|
if (this.config.debug === 'all' || this.config.debug === 'clappr') {
|
|
76
73
|
Log.setLevel(0);
|
|
77
74
|
}
|
|
78
|
-
trace(`${T} init`, {
|
|
79
|
-
// TODO selected options
|
|
80
|
-
});
|
|
81
75
|
this.configurePlaybacks();
|
|
82
76
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
83
77
|
const { core, container } = Loader.registeredPlugins;
|
|
@@ -318,17 +312,17 @@ export class Player {
|
|
|
318
312
|
},
|
|
319
313
|
};
|
|
320
314
|
buildCoreOptions(rootNode) {
|
|
321
|
-
this.buildMediaSourcesList();
|
|
322
|
-
const source =
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
315
|
+
const sources = this.buildMediaSourcesList();
|
|
316
|
+
const source = sources[0];
|
|
317
|
+
trace(`${T} buildCoreOptions`, {
|
|
318
|
+
source
|
|
319
|
+
});
|
|
326
320
|
this.rootNode = rootNode;
|
|
327
321
|
const coreOptions = {
|
|
328
322
|
...this.config, // plugin settings
|
|
329
323
|
allowUserInteraction: true,
|
|
330
324
|
autoPlay: false,
|
|
331
|
-
dash: this.config.dash,
|
|
325
|
+
dash: this.config.dash, // TODO move this to the playback section
|
|
332
326
|
debug: this.config.debug || 'none',
|
|
333
327
|
events: this.events,
|
|
334
328
|
height: rootNode.clientHeight,
|
|
@@ -348,7 +342,7 @@ export class Player {
|
|
|
348
342
|
playbackType: this.config.playbackType,
|
|
349
343
|
width: rootNode.clientWidth,
|
|
350
344
|
source: source ? unwrapSource(source) : undefined,
|
|
351
|
-
sources
|
|
345
|
+
sources, // prevent Clappr from loading all sources simultaneously
|
|
352
346
|
strings: this.config.strings,
|
|
353
347
|
};
|
|
354
348
|
return coreOptions;
|
|
@@ -357,8 +351,9 @@ export class Player {
|
|
|
357
351
|
registerPlaybacks();
|
|
358
352
|
}
|
|
359
353
|
buildMediaSourcesList() {
|
|
360
|
-
return buildMediaSourcesList(
|
|
361
|
-
|
|
354
|
+
return buildMediaSourcesList(
|
|
355
|
+
// TODO ensure unsupported sources are filtered out
|
|
356
|
+
this.config.sources.map((s) => wrapSource(s)), this.config.priorityTransport);
|
|
362
357
|
}
|
|
363
358
|
bindContainerEventListeners(player) {
|
|
364
359
|
trace(`${T} bindContainerEventListeners`, {
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,cAAc,aAAa,CAAA;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
package/lib/internal.types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CorePlugin, ContainerPlugin, Playback as ClapprPlayback } from "@clappr/core";
|
|
2
2
|
import { PlaybackType, PlayerDebugTag, PlayerMediaSource } from "./types";
|
|
3
|
+
import { PlaybackError } from "./playback.types";
|
|
3
4
|
type ExternalTrack = {
|
|
4
5
|
kind?: "subtitles" | "captions";
|
|
5
6
|
src: string;
|
|
@@ -35,18 +36,6 @@ export interface CorePlaybackConfig {
|
|
|
35
36
|
preload?: 'metadata' | 'auto' | 'none';
|
|
36
37
|
shakaConfiguration?: ShakaConfig;
|
|
37
38
|
}
|
|
38
|
-
type ErrorLevel = "FATAL" | "WARN" | "INFO";
|
|
39
|
-
/**
|
|
40
|
-
* @beta
|
|
41
|
-
*/
|
|
42
|
-
export type PlaybackError = {
|
|
43
|
-
code?: number | string;
|
|
44
|
-
description: string;
|
|
45
|
-
raw?: MediaError;
|
|
46
|
-
level?: ErrorLevel;
|
|
47
|
-
message: string;
|
|
48
|
-
scope?: string;
|
|
49
|
-
};
|
|
50
39
|
/**
|
|
51
40
|
* @internal
|
|
52
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../src/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,IAAI,cAAc,EAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../src/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,IAAI,cAAc,EAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAA;AAED,KAAK,kBAAkB,GAAG;IAExB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MA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QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA"}
|
package/lib/playback.types.d.ts
CHANGED
|
@@ -43,4 +43,14 @@ export declare enum PlaybackErrorCode {
|
|
|
43
43
|
MediaSourceUnavailable = 1,
|
|
44
44
|
QualityLevelUnavailable = 2
|
|
45
45
|
}
|
|
46
|
+
export type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
|
|
47
|
+
/**
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export interface PlaybackError {
|
|
51
|
+
code: PlaybackErrorCode;
|
|
52
|
+
description: string;
|
|
53
|
+
level: ErrorLevel;
|
|
54
|
+
message: string;
|
|
55
|
+
}
|
|
46
56
|
//# sourceMappingURL=playback.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,IAAI;IACX,sBAAsB,IAAI;IAC1B,uBAAuB,IAAI;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,UAAU,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashPlayback.d.ts","sourceRoot":"","sources":["../../../src/plugins/dash-playback/DashPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,UAAU,EAAO,QAAQ,
|
|
1
|
+
{"version":3,"file":"DashPlayback.d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governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
|
-
import { Events, HTML5Video, Log, Playback, Utils } from '@clappr/core';
|
|
4
|
+
import { Events, HTML5Video, Log, Playback, PlayerError, Utils } from '@clappr/core';
|
|
5
5
|
import { trace } from '@gcorevideo/utils';
|
|
6
6
|
import assert from 'assert';
|
|
7
7
|
import DASHJS from 'dashjs';
|
|
@@ -278,36 +278,39 @@ export default class DashPlayback extends HTML5Video {
|
|
|
278
278
|
};
|
|
279
279
|
_onDASHJSSError = (event) => {
|
|
280
280
|
trace(`${T} _onDASHJSSError`, { event });
|
|
281
|
-
// TODO figure out what's for
|
|
282
281
|
this._stopTimeUpdateTimer();
|
|
283
282
|
const e = event.error;
|
|
284
283
|
switch (e.code) {
|
|
285
284
|
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE:
|
|
286
285
|
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE:
|
|
287
286
|
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_MANIFEST_CODE:
|
|
288
|
-
|
|
287
|
+
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE:
|
|
288
|
+
this.triggerError({
|
|
289
289
|
code: PlaybackErrorCode.MediaSourceUnavailable,
|
|
290
290
|
message: e.message,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
})
|
|
291
|
+
description: e.message,
|
|
292
|
+
level: PlayerError.Levels.FATAL,
|
|
293
|
+
});
|
|
294
294
|
break;
|
|
295
295
|
// TODO more cases
|
|
296
296
|
default:
|
|
297
|
-
this.
|
|
297
|
+
this.triggerError({
|
|
298
298
|
code: PlaybackErrorCode.Generic,
|
|
299
299
|
message: e.message,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
})
|
|
300
|
+
description: e.message,
|
|
301
|
+
level: PlayerError.Levels.FATAL,
|
|
302
|
+
});
|
|
303
303
|
}
|
|
304
|
+
};
|
|
305
|
+
triggerError(error) {
|
|
306
|
+
trace(`${T} triggerError`, { error });
|
|
307
|
+
this.trigger(Events.PLAYBACK_ERROR, error);
|
|
304
308
|
// only reset the dash player in 10ms async, so that the rest of the
|
|
305
309
|
// calling function finishes
|
|
306
310
|
setTimeout(() => {
|
|
307
|
-
|
|
308
|
-
this._dash.reset();
|
|
311
|
+
this.stop();
|
|
309
312
|
}, 10);
|
|
310
|
-
}
|
|
313
|
+
}
|
|
311
314
|
_onTimeUpdate() {
|
|
312
315
|
if (this.startChangeQuality) {
|
|
313
316
|
return;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HTML5Video } from '@clappr/core';
|
|
2
2
|
import HLSJS, { Events as HlsEvents, type ErrorData as HlsErrorData, type FragChangedData, type FragLoadedData, type FragParsingMetadataData, type LevelSwitchingData } from 'hls.js';
|
|
3
|
-
import { QualityLevel } from '../../playback.types.js';
|
|
3
|
+
import { PlaybackError, QualityLevel } from '../../playback.types.js';
|
|
4
4
|
import { PlaybackType } from '../../types';
|
|
5
|
-
type ErrorInfo = Record<string, unknown>;
|
|
6
5
|
export default class HlsPlayback extends HTML5Video {
|
|
7
6
|
private _ccIsSetup;
|
|
8
7
|
private _ccTracksUpdated;
|
|
@@ -65,7 +64,7 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
65
64
|
_onFragmentParsingMetadata(evt: HlsEvents.FRAG_PARSING_METADATA, data: FragParsingMetadataData): void;
|
|
66
65
|
render(): this;
|
|
67
66
|
_ready(): void;
|
|
68
|
-
_recover(evt: HlsEvents.ERROR, data: HlsErrorData, error:
|
|
67
|
+
_recover(evt: HlsEvents.ERROR, data: HlsErrorData, error: PlaybackError): void;
|
|
69
68
|
protected _setupSrc(srcUrl: string): void;
|
|
70
69
|
_startTimeUpdateTimer(): void;
|
|
71
70
|
_stopTimeUpdateTimer(): void;
|
|
@@ -98,6 +97,6 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
98
97
|
get dvrEnabled(): boolean;
|
|
99
98
|
getPlaybackType(): PlaybackType;
|
|
100
99
|
isSeekEnabled(): boolean;
|
|
100
|
+
private triggerError;
|
|
101
101
|
}
|
|
102
|
-
export {};
|
|
103
102
|
//# sourceMappingURL=HlsPlayback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HlsPlayback.d.ts","sourceRoot":"","sources":["../../../src/plugins/hls-playback/HlsPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,UAAU,EAKX,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,EACZ,MAAM,IAAI,SAAS,EAEnB,KAAK,SAAS,IAAI,YAAY,EAE9B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAG5B,KAAK,kBAAkB,EACxB,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAqB,YAAY,EAA4B,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"HlsPlayback.d.ts","sourceRoot":"","sources":["../../../src/plugins/hls-playback/HlsPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,UAAU,EAKX,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,EACZ,MAAM,IAAI,SAAS,EAEnB,KAAK,SAAS,IAAI,YAAY,EAE9B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAG5B,KAAK,kBAAkB,EACxB,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,aAAa,EAAqB,YAAY,EAA4B,MAAM,yBAAyB,CAAA;AAClH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AA2C1C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IACjD,OAAO,CAAC,UAAU,CAAQ;IAE1B,OAAO,CAAC,gBAAgB,CAAQ;IAEhC,OAAO,CAAC,gBAAgB,CAAwB;IAEhD,OAAO,CAAC,aAAa,CAAsB;IAE3C,OAAO,CAAC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,CAAC,YAAY;CAKrB"}
|
|
@@ -331,9 +331,7 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
331
331
|
else {
|
|
332
332
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
333
333
|
error.level = PlayerError.Levels.FATAL;
|
|
334
|
-
|
|
335
|
-
this.trigger(Events.PLAYBACK_ERROR, formattedError);
|
|
336
|
-
this.stop();
|
|
334
|
+
this.triggerError(error);
|
|
337
335
|
}
|
|
338
336
|
}
|
|
339
337
|
// this playback manages the src on the video element itself
|
|
@@ -415,12 +413,11 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
415
413
|
}
|
|
416
414
|
_onHLSJSError(evt, data) {
|
|
417
415
|
const error = {
|
|
418
|
-
// code: `${data.type}_${data.details}`,
|
|
419
416
|
code: PlaybackErrorCode.Generic,
|
|
420
|
-
description: `${this.name} error: type: ${data.type}, details: ${data.details}`,
|
|
421
|
-
|
|
417
|
+
description: `${this.name} error: type: ${data.type}, details: ${data.details} fatal: ${data.fatal}`,
|
|
418
|
+
level: data.fatal ? PlayerError.Levels.FATAL : PlayerError.Levels.WARN,
|
|
419
|
+
message: `${this.name} error: type: ${data.type}, details: ${data.details}`,
|
|
422
420
|
};
|
|
423
|
-
let formattedError;
|
|
424
421
|
if (data.response) {
|
|
425
422
|
error.description += `, response: ${JSON.stringify(data.response)}`;
|
|
426
423
|
}
|
|
@@ -444,18 +441,8 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
444
441
|
evt,
|
|
445
442
|
data,
|
|
446
443
|
});
|
|
447
|
-
error.code =
|
|
448
|
-
|
|
449
|
-
HLSJS.ErrorDetails.MANIFEST_LOAD_TIMEOUT,
|
|
450
|
-
HLSJS.ErrorDetails.MANIFEST_PARSING_ERROR
|
|
451
|
-
].includes(data.details)
|
|
452
|
-
? PlaybackErrorCode.MediaSourceUnavailable
|
|
453
|
-
: PlaybackErrorCode.QualityLevelUnavailable;
|
|
454
|
-
formattedError = this.createError(error, {
|
|
455
|
-
useCodePrefix: false,
|
|
456
|
-
});
|
|
457
|
-
this.trigger(Events.PLAYBACK_ERROR, formattedError);
|
|
458
|
-
this.stop();
|
|
444
|
+
error.code = PlaybackErrorCode.MediaSourceUnavailable;
|
|
445
|
+
this.triggerError(error);
|
|
459
446
|
break;
|
|
460
447
|
default:
|
|
461
448
|
Log.warn('hlsjs: trying to recover from network error.', {
|
|
@@ -463,8 +450,7 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
463
450
|
data,
|
|
464
451
|
});
|
|
465
452
|
error.level = PlayerError.Levels.WARN;
|
|
466
|
-
|
|
467
|
-
this._hls.startLoad();
|
|
453
|
+
this._hls?.startLoad();
|
|
468
454
|
break;
|
|
469
455
|
}
|
|
470
456
|
break;
|
|
@@ -478,22 +464,14 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
478
464
|
break;
|
|
479
465
|
default:
|
|
480
466
|
Log.error('hlsjs: could not recover from error.', { evt, data });
|
|
481
|
-
|
|
482
|
-
useCodePrefix: false,
|
|
483
|
-
});
|
|
484
|
-
this.trigger(Events.PLAYBACK_ERROR, formattedError);
|
|
485
|
-
this.stop();
|
|
467
|
+
this.triggerError(error);
|
|
486
468
|
break;
|
|
487
469
|
}
|
|
488
470
|
}
|
|
489
471
|
else {
|
|
490
472
|
Log.error('hlsjs: could not recover from error after maximum number of attempts.', { evt, data });
|
|
491
473
|
// TODO
|
|
492
|
-
|
|
493
|
-
useCodePrefix: false,
|
|
494
|
-
});
|
|
495
|
-
this.trigger(Events.PLAYBACK_ERROR, formattedError);
|
|
496
|
-
this.stop();
|
|
474
|
+
this.triggerError(error);
|
|
497
475
|
}
|
|
498
476
|
}
|
|
499
477
|
else {
|
|
@@ -504,14 +482,9 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
504
482
|
if (this.options.playback.triggerFatalErrorOnResourceDenied &&
|
|
505
483
|
this._keyIsDenied(data)) {
|
|
506
484
|
Log.error('hlsjs: could not load decrypt key.', { evt, data });
|
|
507
|
-
|
|
508
|
-
useCodePrefix: false,
|
|
509
|
-
});
|
|
510
|
-
this.trigger(Events.PLAYBACK_ERROR, formattedError);
|
|
511
|
-
this.stop();
|
|
485
|
+
this.triggerError(error);
|
|
512
486
|
return;
|
|
513
487
|
}
|
|
514
|
-
error.level = PlayerError.Levels.WARN;
|
|
515
488
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
516
489
|
}
|
|
517
490
|
}
|
|
@@ -819,6 +792,11 @@ export default class HlsPlayback extends HTML5Video {
|
|
|
819
792
|
isSeekEnabled() {
|
|
820
793
|
return this._playbackType === Playback.VOD || this.dvrEnabled;
|
|
821
794
|
}
|
|
795
|
+
triggerError(error) {
|
|
796
|
+
trace(`${T} triggerError`, { error });
|
|
797
|
+
this.trigger(Events.PLAYBACK_ERROR, error);
|
|
798
|
+
this.stop();
|
|
799
|
+
}
|
|
822
800
|
}
|
|
823
801
|
HlsPlayback.canPlay = function (resource, mimeType) {
|
|
824
802
|
const resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAA;IAClC,GAAG,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACjC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACrC,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAiB5E;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,qBAAqB,EAAE,EAChC,iBAAiB,GAAE,mBAA4B,GAC9C,qBAAqB,EAAE,CA4BzB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAEzD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,iBAAiB,GAAG,qBAAqB,CAEtE;AAYD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,WAK7D;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,WAO5D"}
|