Skip to content

Commit 31cbfa7

Browse files
committed
updated applyDynamicConfig method parameter types in HlsJsP2PEngine and ShakaP2PEngine
1 parent 519e1b6 commit 31cbfa7

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

packages/p2p-media-loader-hlsjs/src/engine.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,25 @@ export class HlsJsP2PEngine {
100100
private currentHlsInstance?: Hls;
101101
private readonly debug = debug("p2pml-hlsjs:engine");
102102

103-
/** Static method to inject mixins for extending functionality */
103+
/**
104+
* Enhances a given Hls.js class by injecting additional P2P (peer-to-peer) functionalities.
105+
*
106+
* @returns {HlsWithP2PInstance} - The enhanced class with P2P functionalities.
107+
*
108+
* @example
109+
* const HlsWithP2P = HlsJsP2PEngine.injectMixin(Hls);
110+
*
111+
* const hls = new HlsWithP2P({
112+
* p2p: {
113+
* core: {
114+
* // P2P configuration
115+
* },
116+
* onHlsJsCreated(hls) {
117+
* // Do something with the Hls.js instance
118+
* },
119+
* },
120+
* });
121+
*/
104122
static injectMixin = injectMixin;
105123

106124
/**
@@ -195,7 +213,7 @@ export class HlsJsP2PEngine {
195213
*
196214
* hlsP2PEngine.applyDynamicConfig(newDynamicConfig);
197215
*/
198-
applyDynamicConfig(dynamicConfig: DeepReadonly<DynamicHlsJsP2PEngineConfig>) {
216+
applyDynamicConfig(dynamicConfig: DynamicHlsJsP2PEngineConfig) {
199217
if (dynamicConfig.core) this.core.applyDynamicConfig(dynamicConfig.core);
200218
}
201219

packages/p2p-media-loader-shaka/src/engine.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class ShakaP2PEngine {
8888
* Constructs an instance of ShakaP2PEngine.
8989
*
9090
* @param config Optional configuration for customizing the P2P engine's behavior.
91-
* @param shaka The Shaka Player library, typically provided as a global variable by including Shaka Player in your project.
91+
* @param shaka The Shaka Player library instance.
9292
*/
9393
constructor(config?: PartialShakaEngineConfig, shaka = window.shaka) {
9494
validateShaka(shaka);
@@ -120,11 +120,10 @@ export class ShakaP2PEngine {
120120

121121
/**
122122
* Applies dynamic configuration updates to the P2P engine.
123-
* This method allows for runtime adjustments to the engine's settings.
124123
*
125124
* @param dynamicConfig Configuration changes to apply.
126125
*/
127-
applyDynamicConfig(dynamicConfig: DeepReadonly<DynamicShakaP2PEngineConfig>) {
126+
applyDynamicConfig(dynamicConfig: DynamicShakaP2PEngineConfig) {
128127
if (dynamicConfig.core) this.core.applyDynamicConfig(dynamicConfig.core);
129128
}
130129

0 commit comments

Comments
 (0)