File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
p2p-media-loader-hlsjs/src
p2p-media-loader-shaka/src Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,25 @@ export class HlsJsP2PEngine {
100
100
private currentHlsInstance ?: Hls ;
101
101
private readonly debug = debug ( "p2pml-hlsjs:engine" ) ;
102
102
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
+ */
104
122
static injectMixin = injectMixin ;
105
123
106
124
/**
@@ -195,7 +213,7 @@ export class HlsJsP2PEngine {
195
213
*
196
214
* hlsP2PEngine.applyDynamicConfig(newDynamicConfig);
197
215
*/
198
- applyDynamicConfig ( dynamicConfig : DeepReadonly < DynamicHlsJsP2PEngineConfig > ) {
216
+ applyDynamicConfig ( dynamicConfig : DynamicHlsJsP2PEngineConfig ) {
199
217
if ( dynamicConfig . core ) this . core . applyDynamicConfig ( dynamicConfig . core ) ;
200
218
}
201
219
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export class ShakaP2PEngine {
88
88
* Constructs an instance of ShakaP2PEngine.
89
89
*
90
90
* @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 .
92
92
*/
93
93
constructor ( config ?: PartialShakaEngineConfig , shaka = window . shaka ) {
94
94
validateShaka ( shaka ) ;
@@ -120,11 +120,10 @@ export class ShakaP2PEngine {
120
120
121
121
/**
122
122
* Applies dynamic configuration updates to the P2P engine.
123
- * This method allows for runtime adjustments to the engine's settings.
124
123
*
125
124
* @param dynamicConfig Configuration changes to apply.
126
125
*/
127
- applyDynamicConfig ( dynamicConfig : DeepReadonly < DynamicShakaP2PEngineConfig > ) {
126
+ applyDynamicConfig ( dynamicConfig : DynamicShakaP2PEngineConfig ) {
128
127
if ( dynamicConfig . core ) this . core . applyDynamicConfig ( dynamicConfig . core ) ;
129
128
}
130
129
You can’t perform that action at this time.
0 commit comments