senza-sdk 4.2.52 → 4.2.53
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/bundle.js +1 -1
- package/package.json +1 -1
- package/src/senzaShakaPlayer.js +22 -0
package/package.json
CHANGED
package/src/senzaShakaPlayer.js
CHANGED
|
@@ -249,6 +249,28 @@ export class SenzaShakaPlayer extends shaka.Player {
|
|
|
249
249
|
|
|
250
250
|
this.videoElement = null;
|
|
251
251
|
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Unloads the currently playing stream, if any.
|
|
255
|
+
*
|
|
256
|
+
* @param {boolean=} initializeMediaSource
|
|
257
|
+
* @param {boolean=} keepAdManager
|
|
258
|
+
* @return {!Promise}
|
|
259
|
+
* @export
|
|
260
|
+
*/
|
|
261
|
+
async unload(initializeMediaSource = true, keepAdManager = false) {
|
|
262
|
+
// Call the remote player's unload method
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
await remotePlayer.unload();
|
|
266
|
+
} catch (error) {
|
|
267
|
+
sdkLogger.error("Failed to unload remote player:", error);
|
|
268
|
+
this.handleSenzaError(error.code, error.message);
|
|
269
|
+
}
|
|
270
|
+
// Call the original unload method
|
|
271
|
+
await super.unload(initializeMediaSource, keepAdManager);
|
|
272
|
+
}
|
|
273
|
+
|
|
252
274
|
/**
|
|
253
275
|
* Overrides the getTextTracks method to use the remote player's text tracks.
|
|
254
276
|
* @returns {Array} An array of text tracks.
|