rx-player 3.30.1-dev.2023032300 → 3.30.1-dev.2023032301

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,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "3.30.1-dev.2023032300",
4
+ "version": "3.30.1-dev.2023032301",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/rx-player.js",
7
7
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  sonar.projectKey=rx-player
2
2
  sonar.organization=rx-player
3
3
  sonar.projectName=rx-player
4
- sonar.projectVersion=3.30.1-dev.2023032300
4
+ sonar.projectVersion=3.30.1-dev.2023032301
5
5
  sonar.sources=./src,./demo,./tests
6
6
  sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
7
7
  sonar.host.url=https://sonarcloud.io
@@ -36,7 +36,7 @@ export default async function loadSession(
36
36
  session : MediaKeySession | ICustomMediaKeySession,
37
37
  sessionId : string
38
38
  ) : Promise<boolean> {
39
- log.info("Compat/DRM: Load persisted session", sessionId);
39
+ log.info("DRM: Load persisted session", sessionId);
40
40
  const isLoaded = await session.load(sessionId);
41
41
 
42
42
  if (!isLoaded || session.keyStatuses.size > 0) {
@@ -167,6 +167,7 @@ export default class PlaybackObserver {
167
167
  */
168
168
  public setCurrentTime(time: number) : void {
169
169
  this._internalSeeksIncoming.push(time);
170
+ log.info("API: Seeking internally", time);
170
171
  this._mediaElement.currentTime = time;
171
172
  }
172
173
 
@@ -364,7 +364,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
364
364
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
365
365
  videoElement.preload = "auto";
366
366
 
367
- this.version = /* PLAYER_VERSION */"3.30.1-dev.2023032300";
367
+ this.version = /* PLAYER_VERSION */"3.30.1-dev.2023032301";
368
368
  this.log = log;
369
369
  this.state = "STOPPED";
370
370
  this.videoElement = videoElement;
@@ -1581,6 +1581,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
1581
1581
  if (positionWanted === undefined) {
1582
1582
  throw new Error("invalid time given");
1583
1583
  }
1584
+ log.info("API: API Seek to", positionWanted);
1584
1585
  this.videoElement.currentTime = positionWanted;
1585
1586
  return positionWanted;
1586
1587
  }
@@ -2985,7 +2986,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
2985
2986
  return mediaElementTrackChoiceManager;
2986
2987
  }
2987
2988
  }
2988
- Player.version = /* PLAYER_VERSION */"3.30.1-dev.2023032300";
2989
+ Player.version = /* PLAYER_VERSION */"3.30.1-dev.2023032301";
2989
2990
 
2990
2991
  /** Every events sent by the RxPlayer's public API. */
2991
2992
  interface IPublicAPIEvent {
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import log from "../../../log";
17
18
  import LoadedSessionsStore from "./loaded_sessions_store";
18
19
 
19
20
  /**
@@ -32,7 +33,7 @@ export default async function cleanOldLoadedSessions(
32
33
  if (limit < 0 || limit >= loadedSessionsStore.getLength()) {
33
34
  return ;
34
35
  }
35
-
36
+ log.info("DRM: LSS cache limit exceeded", limit, loadedSessionsStore.getLength());
36
37
  const proms : Array<Promise<unknown>> = [];
37
38
  const entries = loadedSessionsStore.getAll().slice(); // clone
38
39
  const toDelete = entries.length - limit;
@@ -63,6 +63,7 @@ export default class LoadedSessionsStore {
63
63
  sessionType : MediaKeySessionType
64
64
  ) : IStoredSessionEntry {
65
65
  const keySessionRecord = new KeySessionRecord(initData);
66
+ log.debug("DRM-LSS: calling `createSession`", sessionType);
66
67
  const mediaKeySession = this._mediaKeys.createSession(sessionType);
67
68
  const entry = { mediaKeySession,
68
69
  sessionType,
@@ -73,6 +74,8 @@ export default class LoadedSessionsStore {
73
74
  if (!isNullOrUndefined(mediaKeySession.closed)) {
74
75
  mediaKeySession.closed
75
76
  .then(() => {
77
+ log.info("DRM-LSS: session was closed, removing it.",
78
+ mediaKeySession.sessionId);
76
79
  const index = this.getIndex(keySessionRecord);
77
80
  if (index >= 0 &&
78
81
  this._storage[index].mediaKeySession === mediaKeySession)
@@ -86,8 +89,8 @@ export default class LoadedSessionsStore {
86
89
  });
87
90
  }
88
91
 
89
- log.debug("DRM-LSS: Add MediaKeySession", entry.sessionType);
90
92
  this._storage.push({ ...entry });
93
+ log.debug("DRM-LSS: MediaKeySession added", entry.sessionType, this._storage.length);
91
94
  return entry;
92
95
  }
93
96
 
@@ -111,6 +114,8 @@ export default class LoadedSessionsStore {
111
114
  if (stored.keySessionRecord.isCompatibleWith(initializationData)) {
112
115
  this._storage.splice(i, 1);
113
116
  this._storage.push(stored);
117
+ log.debug("DRM-LSS: Reusing session:",
118
+ stored.mediaKeySession.sessionId, stored.sessionType);
114
119
  return { ...stored };
115
120
  }
116
121
  }
@@ -332,6 +337,8 @@ export default class LoadedSessionsStore {
332
337
  for (let i = this._storage.length - 1; i >= 0; i--) {
333
338
  const stored = this._storage[i];
334
339
  if (stored.mediaKeySession === mediaKeySession) {
340
+ log.debug("DRM-LSS: Removing session without closing it",
341
+ mediaKeySession.sessionId);
335
342
  this._storage.splice(i, 1);
336
343
  return true;
337
344
  }
@@ -664,7 +664,6 @@ export default class MediaSourceContentInitializer extends ContentInitializer {
664
664
  this.trigger("activePeriodChanged", { period });
665
665
  });
666
666
  contentTimeBoundariesObserver.addEventListener("durationUpdate", (newDuration) => {
667
- log.debug("Init: Duration has to be updated.", newDuration);
668
667
  mediaDurationUpdater.updateKnownDuration(newDuration);
669
668
  });
670
669
  contentTimeBoundariesObserver.addEventListener("endOfStream", () => {