eb-player 2.0.6 → 2.0.7
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/build/ebplayer.bundle.js +30 -25
- package/dist/build/ebplayer.bundle.js.map +1 -1
- package/dist/build/types/eb-player.d.ts.map +1 -1
- package/dist/build/types/engines/hls.d.ts +7 -0
- package/dist/build/types/engines/hls.d.ts.map +1 -1
- package/dist/players/equipe/EB_lequipe-preprod.js +7 -7
- package/dist/players/equipe/equipe.js +7 -7
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EBPlayer = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var __EB_PLAYER_VERSION__ = "2.0.
|
|
7
|
+
var __EB_PLAYER_VERSION__ = "2.0.7";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Finite State Machine for player playback state transitions.
|
|
@@ -5112,6 +5112,14 @@
|
|
|
5112
5112
|
getDriver() {
|
|
5113
5113
|
return this.driver;
|
|
5114
5114
|
}
|
|
5115
|
+
/**
|
|
5116
|
+
* Returns the CDN token manager used by this engine.
|
|
5117
|
+
* Allows the snapshot handler to share the same manager (avoids duplicate token requests).
|
|
5118
|
+
* Returns null when no token URL is configured or before init().
|
|
5119
|
+
*/
|
|
5120
|
+
getTokenManager() {
|
|
5121
|
+
return this.tokenManager;
|
|
5122
|
+
}
|
|
5115
5123
|
// -------------------------------------------------------------------------
|
|
5116
5124
|
// BaseEngine hooks
|
|
5117
5125
|
// -------------------------------------------------------------------------
|
|
@@ -6366,30 +6374,14 @@
|
|
|
6366
6374
|
else {
|
|
6367
6375
|
const win = window;
|
|
6368
6376
|
if (win.Hls) {
|
|
6369
|
-
//
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
snapshotTokenManager = new CDNTokenManager({
|
|
6373
|
-
token: mergedConfig.token,
|
|
6374
|
-
tokenType: mergedConfig.tokenType,
|
|
6375
|
-
srcInTokenRequest: mergedConfig.srcInTokenRequest,
|
|
6376
|
-
extraParamsCallback: (mergedConfig.engineSettings.extraParamsCallback ?? mergedConfig.extraParamsCallback),
|
|
6377
|
-
onCDNTokenError: mergedConfig.engineSettings.onCDNTokenError
|
|
6378
|
-
});
|
|
6379
|
-
}
|
|
6377
|
+
// Share the main engine's token manager with the snapshot handler
|
|
6378
|
+
// to avoid duplicate token requests (one CDNTokenManager per player instance)
|
|
6379
|
+
const sharedTokenManager = engine.getTokenManager();
|
|
6380
6380
|
// Build DRM config (emeEnabled, drmSystems, licenseXhrSetup) for the snapshot hls.js instance
|
|
6381
|
-
const snapshotDrmConfigurator = new DrmConfigurator(
|
|
6381
|
+
const snapshotDrmConfigurator = new DrmConfigurator(sharedTokenManager);
|
|
6382
6382
|
const snapshotDrmConfig = snapshotDrmConfigurator.buildHlsConfig(mergedConfig.engineSettings);
|
|
6383
|
-
const handler = new HlsSnapshotHandler({ src, engineSettings: { ...mergedConfig.engineSettings, ...snapshotDrmConfig } },
|
|
6384
|
-
|
|
6385
|
-
const tokenReady = snapshotTokenManager && src
|
|
6386
|
-
? snapshotTokenManager.fetchToken({ src }).catch((error) => {
|
|
6387
|
-
console.warn('EBPlayer: Snapshot token fetch failed:', error);
|
|
6388
|
-
})
|
|
6389
|
-
: Promise.resolve();
|
|
6390
|
-
tokenReady.then(() => {
|
|
6391
|
-
return handler.init(win.Hls);
|
|
6392
|
-
})
|
|
6383
|
+
const handler = new HlsSnapshotHandler({ src, engineSettings: { ...mergedConfig.engineSettings, ...snapshotDrmConfig } }, sharedTokenManager);
|
|
6384
|
+
handler.init(win.Hls)
|
|
6393
6385
|
.then(() => {
|
|
6394
6386
|
activeSnapshotDestroy = () => handler.destroy();
|
|
6395
6387
|
const snapshotVideo = handler.getVideo();
|
|
@@ -6446,9 +6438,22 @@
|
|
|
6446
6438
|
}, 100);
|
|
6447
6439
|
});
|
|
6448
6440
|
// Auto-open the stream if src is provided in config (matches legacy player behaviour
|
|
6449
|
-
// where consumers call start({ src: '...' }) and expect playback to begin immediately)
|
|
6441
|
+
// where consumers call start({ src: '...' }) and expect playback to begin immediately).
|
|
6442
|
+
// When autoplay is false, defer open() until the user requests play — this avoids
|
|
6443
|
+
// fetching CDN tokens and loading manifests before playback is actually needed.
|
|
6450
6444
|
if (mergedConfig.src) {
|
|
6451
|
-
|
|
6445
|
+
if (mergedConfig.autoplay) {
|
|
6446
|
+
reference.open(mergedConfig.src);
|
|
6447
|
+
}
|
|
6448
|
+
else {
|
|
6449
|
+
let deferredOpen = true;
|
|
6450
|
+
controller.bus.on('play', () => {
|
|
6451
|
+
if (deferredOpen) {
|
|
6452
|
+
deferredOpen = false;
|
|
6453
|
+
reference.open(mergedConfig.src);
|
|
6454
|
+
}
|
|
6455
|
+
}, { signal: controller.signal });
|
|
6456
|
+
}
|
|
6452
6457
|
}
|
|
6453
6458
|
return reference;
|
|
6454
6459
|
}
|