senza-sdk 4.2.51 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "senza-sdk",
3
- "version": "4.2.51",
3
+ "version": "4.2.53",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -258,6 +258,7 @@ class RemotePlayer extends EventTarget {
258
258
  }
259
259
  const previousCurrentTime = this._videoElement.currentTime;
260
260
  this._isSeekingByPlatform = true;
261
+ this._videoElement.playbackRate = 1.0;
261
262
  this._videoElement.currentTime += event.detail; // event.detail contains the diff between the video and the audio
262
263
  sdkLogger.info(`Adding ${event.detail} seconds, previousTime=${previousCurrentTime} currentTime=${this._videoElement.currentTime}`);
263
264
  });
@@ -1466,7 +1467,7 @@ class RemotePlayer extends EventTarget {
1466
1467
  // The platform could be currently syncing audio/video using playback rate. Reset when performing seek.
1467
1468
  if (this._videoElement) {
1468
1469
  this._videoElement.playbackRate = 1.0;
1469
- // on seek we need to reset any on going sync operation
1470
+ // For local seek, we need to reset any ongoing sync operation
1470
1471
  this._ptsSessionId++;
1471
1472
  }
1472
1473
 
@@ -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.