@amazon/vinyl 1.2.1 → 1.2.2

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.
Files changed (89) hide show
  1. package/dist/index.cjs +13 -4
  2. package/dist/index.cjs.map +2 -2
  3. package/dist/index.js +18 -9
  4. package/dist/index.js.map +3 -3
  5. package/dist/test/integ.es5.js +60 -60
  6. package/dist/test/integ.js +49 -4
  7. package/dist/test/integ.js.map +2 -2
  8. package/dist/types/current/ad/AdBreakInfo.d.ts.map +1 -1
  9. package/dist/types/current/ad/AdControllerImpl.d.ts +18 -2
  10. package/dist/types/current/ad/AdControllerImpl.d.ts.map +1 -1
  11. package/dist/types/current/ad/AdControllerImpl.js +58 -22
  12. package/dist/types/current/ad/discoverHlsInterstitials.d.ts.map +1 -1
  13. package/dist/types/current/ad/discoverHlsInterstitials.js +5 -3
  14. package/dist/types/current/drm/DrmControllerImpl.d.ts +6 -0
  15. package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
  16. package/dist/types/current/drm/DrmControllerImpl.js +13 -1
  17. package/dist/types/current/playback/createStallDetector.d.ts +43 -0
  18. package/dist/types/current/playback/createStallDetector.d.ts.map +1 -0
  19. package/dist/types/current/playback/createStallDetector.js +101 -0
  20. package/dist/types/current/playback/createStallMonitor.d.ts +45 -0
  21. package/dist/types/current/playback/createStallMonitor.d.ts.map +1 -0
  22. package/dist/types/current/playback/createStallMonitor.js +99 -0
  23. package/dist/types/current/streaming/AudioOptions.d.ts +27 -0
  24. package/dist/types/current/streaming/AudioOptions.d.ts.map +1 -1
  25. package/dist/types/current/streaming/AudioOptions.js +5 -1
  26. package/dist/types/current/streaming/LoadMetric.d.ts +15 -1
  27. package/dist/types/current/streaming/LoadMetric.d.ts.map +1 -1
  28. package/dist/types/current/streaming/createTimelineContentTypesValue.d.ts +21 -0
  29. package/dist/types/current/streaming/createTimelineContentTypesValue.d.ts.map +1 -0
  30. package/dist/types/current/streaming/createTimelineContentTypesValue.js +25 -0
  31. package/dist/types/current/text/SidecarTextTrackLoader.d.ts.map +1 -1
  32. package/dist/types/current/text/SidecarTextTrackLoader.js +4 -4
  33. package/dist/types/current/text/TextTrack.d.ts.map +1 -1
  34. package/dist/types/current/text/discoverDashTextTracks.d.ts +2 -2
  35. package/dist/types/current/text/discoverDashTextTracks.js +4 -3
  36. package/dist/types/current/text/parseWebVtt.d.ts.map +1 -1
  37. package/dist/types/current/text/parseWebVtt.js +3 -2
  38. package/dist/types/current/track/mse/MseTrack.d.ts +0 -1
  39. package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
  40. package/dist/types/current/track/mse/MseTrack.js +4 -5
  41. package/dist/types/current/tsconfig.tsbuildinfo +1 -1
  42. package/dist/types/ts3.7/ad/AdControllerImpl.d.ts +18 -2
  43. package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +6 -0
  44. package/dist/types/ts3.7/playback/createStallDetector.d.ts +43 -0
  45. package/dist/types/ts3.7/playback/createStallMonitor.d.ts +45 -0
  46. package/dist/types/ts3.7/streaming/AudioOptions.d.ts +27 -0
  47. package/dist/types/ts3.7/streaming/LoadMetric.d.ts +15 -1
  48. package/dist/types/ts3.7/streaming/createTimelineContentTypesValue.d.ts +21 -0
  49. package/dist/types/ts3.7/text/discoverDashTextTracks.d.ts +2 -2
  50. package/dist/types/ts3.7/track/mse/MseTrack.d.ts +0 -1
  51. package/dist/types/ts4.1/ad/AdControllerImpl.d.ts +18 -2
  52. package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +6 -0
  53. package/dist/types/ts4.1/playback/createStallDetector.d.ts +43 -0
  54. package/dist/types/ts4.1/playback/createStallMonitor.d.ts +45 -0
  55. package/dist/types/ts4.1/streaming/AudioOptions.d.ts +27 -0
  56. package/dist/types/ts4.1/streaming/LoadMetric.d.ts +15 -1
  57. package/dist/types/ts4.1/streaming/createTimelineContentTypesValue.d.ts +21 -0
  58. package/dist/types/ts4.1/text/discoverDashTextTracks.d.ts +2 -2
  59. package/dist/types/ts4.1/track/mse/MseTrack.d.ts +0 -1
  60. package/dist/types/ts4.7/ad/AdControllerImpl.d.ts +18 -2
  61. package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +6 -0
  62. package/dist/types/ts4.7/playback/createStallDetector.d.ts +43 -0
  63. package/dist/types/ts4.7/playback/createStallMonitor.d.ts +45 -0
  64. package/dist/types/ts4.7/streaming/AudioOptions.d.ts +27 -0
  65. package/dist/types/ts4.7/streaming/LoadMetric.d.ts +15 -1
  66. package/dist/types/ts4.7/streaming/createTimelineContentTypesValue.d.ts +21 -0
  67. package/dist/types/ts4.7/text/discoverDashTextTracks.d.ts +2 -2
  68. package/dist/types/ts4.7/track/mse/MseTrack.d.ts +0 -1
  69. package/dist/unit/types/current/ad/AdControllerImpl.test.js +203 -5
  70. package/dist/unit/types/current/ad/discoverHlsInterstitials.test.js +2 -1
  71. package/dist/unit/types/current/drm/DrmControllerImpl.test.js +30 -1
  72. package/dist/unit/types/current/playback/createStallDetector.test.d.ts +2 -0
  73. package/dist/unit/types/current/playback/createStallDetector.test.d.ts.map +1 -0
  74. package/dist/unit/types/current/playback/createStallDetector.test.js +163 -0
  75. package/dist/unit/types/current/playback/createStallMonitor.test.d.ts +2 -0
  76. package/dist/unit/types/current/playback/createStallMonitor.test.d.ts.map +1 -0
  77. package/dist/unit/types/current/playback/createStallMonitor.test.js +163 -0
  78. package/dist/unit/types/current/streaming/MseTrack.test.js +15 -0
  79. package/dist/unit/types/current/streaming/createTimelineContentTypesValue.test.d.ts +2 -0
  80. package/dist/unit/types/current/streaming/createTimelineContentTypesValue.test.d.ts.map +1 -0
  81. package/dist/unit/types/current/streaming/createTimelineContentTypesValue.test.js +57 -0
  82. package/dist/unit/types/current/text/TextTrack.test.d.ts +2 -0
  83. package/dist/unit/types/current/text/TextTrack.test.d.ts.map +1 -0
  84. package/dist/unit/types/current/text/TextTrack.test.js +12 -0
  85. package/dist/unit/types/current/text/discoverDashTextTracks.test.js +17 -0
  86. package/dist/unit/types/current/text/parseWebVtt.test.js +26 -0
  87. package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
  88. package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
  89. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -60,6 +60,7 @@ __export(index_exports, {
60
60
  DrmError: () => DrmError,
61
61
  DrmKeySystem: () => DrmKeySystem,
62
62
  DrmRobustness: () => DrmRobustness,
63
+ EXCESSIVE_SESSION_COUNT: () => EXCESSIVE_SESSION_COUNT,
63
64
  FAIR_PLAY_KEY_SYSTEMS: () => FAIR_PLAY_KEY_SYSTEMS,
64
65
  FixedPlaybackQuality: () => FixedPlaybackQuality,
65
66
  HlsManifestControllerImpl: () => HlsManifestControllerImpl,
@@ -2019,7 +2020,6 @@ var MseTrack = class extends TrackBase {
2019
2020
  const deps = depsContainer.dependencies;
2020
2021
  super(uri, type, deps);
2021
2022
  __publicField(this, "streams", []);
2022
- __publicField(this, "disposeAbort", /* @__PURE__ */ new import_vinyl_util27.Abort());
2023
2023
  __publicField(this, "lastPreloadOptions", null);
2024
2024
  __publicField(this, "activateOptions", null);
2025
2025
  __publicField(this, "allFetchedRanges", []);
@@ -2054,14 +2054,14 @@ var MseTrack = class extends TrackBase {
2054
2054
  if (this.activateOptions) {
2055
2055
  this.deps.drmController.initializeForPlayback(
2056
2056
  event.current,
2057
- this.disposeAbort
2057
+ this.drmSessionAbort.value
2058
2058
  );
2059
2059
  }
2060
2060
  });
2061
2061
  this.on("bufferingQualityChange", (event) => {
2062
2062
  this.deps.drmController.setBufferingDrmInfo(
2063
2063
  event.current,
2064
- this.disposeAbort
2064
+ this.drmSessionAbort.value
2065
2065
  );
2066
2066
  });
2067
2067
  add(
@@ -2217,7 +2217,7 @@ var MseTrack = class extends TrackBase {
2217
2217
  this.streams.forEach((stream) => {
2218
2218
  this.deps.drmController.initializeForPlayback(
2219
2219
  stream.streamingQuality,
2220
- this.disposeAbort
2220
+ this.drmSessionAbort.value
2221
2221
  );
2222
2222
  });
2223
2223
  this.deps.playbackSource.src = this.deps.mediaSourceController.createUrl();
@@ -6778,6 +6778,7 @@ function createFairPlaySessionInitData(initData, contentId, certificateData) {
6778
6778
  // src/drm/DrmControllerImpl.ts
6779
6779
  var LICENSE_TIMEOUT = 90;
6780
6780
  var LICENSE_TIMEOUT_MESSAGE = "License provider timed out after {time}s";
6781
+ var EXCESSIVE_SESSION_COUNT = 20;
6781
6782
  var DrmControllerImpl = class extends import_vinyl_util84.EventHostImpl {
6782
6783
  constructor(deps, options) {
6783
6784
  super();
@@ -6959,12 +6960,20 @@ var DrmControllerImpl = class extends import_vinyl_util84.EventHostImpl {
6959
6960
  keySystemOptions == null ? void 0 : keySystemOptions.initDataTransformer
6960
6961
  );
6961
6962
  this.sessions.push(newSession);
6963
+ (0, import_vinyl_util84.logVerbose)(this, `total sessions: ${this.sessions.length}`);
6964
+ if (this.sessions.length === EXCESSIVE_SESSION_COUNT + 1) {
6965
+ (0, import_vinyl_util84.logWarn)(
6966
+ this,
6967
+ `${this.sessions.length} open key sessions exceeds ${EXCESSIVE_SESSION_COUNT}; sessions may be leaking (not closing on track deactivation)`
6968
+ );
6969
+ }
6962
6970
  this.dispatch("sessionCreate", {
6963
6971
  initDataType: newSession.initDataType,
6964
6972
  mimeType: newSession.mimeType
6965
6973
  });
6966
6974
  newSession.on("closed", () => this.closeSession(newSession));
6967
6975
  abort == null ? void 0 : abort.onAborted(() => {
6976
+ if (this.disposed) return;
6968
6977
  (0, import_vinyl_util84.logDebug)(this, "abort session");
6969
6978
  this.closeSession(newSession);
6970
6979
  });