@amazon/vinyl 4.0.0 → 4.0.1-next.20261016220320
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/index.cjs +40 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +41 -3
- package/dist/index.js.map +2 -2
- package/dist/test/benchmark.es5.js +5 -4
- package/dist/test/benchmark.js +11 -2
- package/dist/test/benchmark.js.map +3 -3
- package/dist/test/errata/mse-changetype-sequence.html +65 -0
- package/dist/test/errata/mse-changetype-sequence.js +179 -0
- package/dist/test/index.html +2 -2
- package/dist/test/integ.es5.js +287 -276
- package/dist/test/integ.js +629 -245
- package/dist/test/integ.js.map +4 -4
- package/dist/test/styles.css +23 -13
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +12 -0
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.js +42 -1
- package/dist/types/current/streaming/buffering/BufferingController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/BufferingController.js +9 -2
- package/dist/types/current/streaming/buffering/MediaSourceController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/MediaSourceController.js +4 -2
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +12 -0
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +12 -0
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +12 -0
- package/dist/unit/types/current/playback/PlaybackControllerImpl.test.js +86 -0
- package/dist/unit/types/current/setup.js +6 -5
- package/dist/unit/types/current/streaming/SegmentControllerImpl.test.js +44 -1
- package/dist/unit/types/current/streaming/buffering/BufferingController.test.js +14 -0
- package/dist/unit/types/current/streaming/buffering/MediaSourceController.test.js +13 -0
- package/dist/unit/types/current/track/dash/createDashFactories.test.js +15 -5
- package/dist/unit/types/current/track/hls/createHlsFactories.test.js +36 -12
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/vinyl/VinylPlayerAdBreaks.test.js +8 -5
- package/dist/vinylTestUtil/index.js +92 -60
- package/dist/vinylTestUtil/index.js.map +4 -4
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.d.ts +8 -5
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.js +23 -29
- package/dist/vinylTestUtil/types/current/media/unlockMediaElement.d.ts +10 -1
- package/dist/vinylTestUtil/types/current/media/unlockMediaElement.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/media/unlockMediaElement.js +34 -6
- package/dist/vinylTestUtil/types/current/player/createVinylSuite.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/player/createVinylSuite.js +6 -1
- package/dist/vinylTestUtil/types/current/player/mediaRef.d.ts +7 -0
- package/dist/vinylTestUtil/types/current/player/mediaRef.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/player/mediaRef.js +8 -1
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/current/ui/requireUserInteraction.d.ts +6 -2
- package/dist/vinylTestUtil/types/current/ui/requireUserInteraction.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/ui/requireUserInteraction.js +31 -15
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.d.ts +9 -2
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.js +10 -7
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.d.ts +4 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.js +3 -2
- package/dist/vinylTestUtil/types/ts3.7/media/FrequencyAnalyzer.d.ts +8 -5
- package/dist/vinylTestUtil/types/ts3.7/media/unlockMediaElement.d.ts +10 -1
- package/dist/vinylTestUtil/types/ts3.7/player/mediaRef.d.ts +7 -0
- package/dist/vinylTestUtil/types/ts3.7/ui/requireUserInteraction.d.ts +6 -2
- package/dist/vinylTestUtil/types/ts3.7/util/playback/expectTrackPlays.d.ts +9 -2
- package/dist/vinylTestUtil/types/ts3.7/util/playback/expectTrackPlaysUntil.d.ts +4 -1
- package/dist/vinylTestUtil/types/ts4.1/media/FrequencyAnalyzer.d.ts +8 -5
- package/dist/vinylTestUtil/types/ts4.1/media/unlockMediaElement.d.ts +10 -1
- package/dist/vinylTestUtil/types/ts4.1/player/mediaRef.d.ts +7 -0
- package/dist/vinylTestUtil/types/ts4.1/ui/requireUserInteraction.d.ts +6 -2
- package/dist/vinylTestUtil/types/ts4.1/util/playback/expectTrackPlays.d.ts +9 -2
- package/dist/vinylTestUtil/types/ts4.1/util/playback/expectTrackPlaysUntil.d.ts +4 -1
- package/dist/vinylTestUtil/types/ts4.7/media/FrequencyAnalyzer.d.ts +8 -5
- package/dist/vinylTestUtil/types/ts4.7/media/unlockMediaElement.d.ts +10 -1
- package/dist/vinylTestUtil/types/ts4.7/player/mediaRef.d.ts +7 -0
- package/dist/vinylTestUtil/types/ts4.7/ui/requireUserInteraction.d.ts +6 -2
- package/dist/vinylTestUtil/types/ts4.7/util/playback/expectTrackPlays.d.ts +9 -2
- package/dist/vinylTestUtil/types/ts4.7/util/playback/expectTrackPlaysUntil.d.ts +4 -1
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -4929,6 +4929,8 @@ var PlaybackControllerImpl = class extends import_vinyl_util47.EventHostImpl {
|
|
|
4929
4929
|
this.initializeMutedEvent();
|
|
4930
4930
|
this.initializeLoopedEvent();
|
|
4931
4931
|
this.initializeReadyStateChangeEvent();
|
|
4932
|
+
this.initializeSeekWaitingEvent();
|
|
4933
|
+
this.initializeSeekPlayingEvent();
|
|
4932
4934
|
}
|
|
4933
4935
|
/**
|
|
4934
4936
|
* Re-dispatches the plain DOM events without extra information.
|
|
@@ -4953,7 +4955,11 @@ var PlaybackControllerImpl = class extends import_vinyl_util47.EventHostImpl {
|
|
|
4953
4955
|
"waiting",
|
|
4954
4956
|
"waitingForKey"
|
|
4955
4957
|
]) {
|
|
4956
|
-
this.domEvents.on((0, import_vinyl_util47.toLowerCase)(key), () =>
|
|
4958
|
+
this.domEvents.on((0, import_vinyl_util47.toLowerCase)(key), () => {
|
|
4959
|
+
if (key === "waiting" && this._waiting) return;
|
|
4960
|
+
if (key === "playing" && this._playing) return;
|
|
4961
|
+
this.dispatch(key, {});
|
|
4962
|
+
});
|
|
4957
4963
|
}
|
|
4958
4964
|
this.domEvents.on("progress", (e) => {
|
|
4959
4965
|
this.dispatch("progress", { loaded: e.loaded, total: e.total });
|
|
@@ -5364,6 +5370,34 @@ var PlaybackControllerImpl = class extends import_vinyl_util47.EventHostImpl {
|
|
|
5364
5370
|
if (!this.paused && !seekAbort.aborted()) this.startStallDetection();
|
|
5365
5371
|
}
|
|
5366
5372
|
}
|
|
5373
|
+
/**
|
|
5374
|
+
* Dispatches `waiting` when a seek while playing targets an unbuffered position and the media element did not.
|
|
5375
|
+
* Safari 27 keeps its readyState while seeking, so it never fires `waiting` for the seek.
|
|
5376
|
+
* @private
|
|
5377
|
+
*/
|
|
5378
|
+
initializeSeekWaitingEvent() {
|
|
5379
|
+
const timeoutSlot = this.disposer.add(new import_vinyl_util47.TimeoutSlot());
|
|
5380
|
+
this.domEvents.on("seeking", () => {
|
|
5381
|
+
timeoutSlot.set(() => {
|
|
5382
|
+
const media = this.media;
|
|
5383
|
+
if (this._waiting || !media.seeking || media.paused) return;
|
|
5384
|
+
const range = this.buffered.getRangeAt(media.currentTime);
|
|
5385
|
+
if (range && range[1] > media.currentTime) return;
|
|
5386
|
+
this.dispatch("waiting", {});
|
|
5387
|
+
}, 0);
|
|
5388
|
+
});
|
|
5389
|
+
}
|
|
5390
|
+
/**
|
|
5391
|
+
* Dispatches `playing` when a seek while playing completes and the media element did not. A seek ends `playing`,
|
|
5392
|
+
* but WebKit only fires `playing` again if its readyState dropped, which it doesn't for a buffered position.
|
|
5393
|
+
* @private
|
|
5394
|
+
*/
|
|
5395
|
+
initializeSeekPlayingEvent() {
|
|
5396
|
+
this.domEvents.on("seeked", () => {
|
|
5397
|
+
if (this._playing || this.media.paused || !this.canPlay) return;
|
|
5398
|
+
this.dispatch("playing", {});
|
|
5399
|
+
});
|
|
5400
|
+
}
|
|
5367
5401
|
/**
|
|
5368
5402
|
* Dispatches a readyStateChange event when {@link readyState} changes.
|
|
5369
5403
|
* @private
|
|
@@ -5903,7 +5937,8 @@ var BufferingControllerImpl = class extends import_vinyl_util51.EventHostImpl {
|
|
|
5903
5937
|
return;
|
|
5904
5938
|
}
|
|
5905
5939
|
this.bufferingQuality = streamingSegment.quality;
|
|
5906
|
-
|
|
5940
|
+
const reinitialized = this.decoderId !== streamingSegment.quality.decoderId;
|
|
5941
|
+
if (reinitialized) {
|
|
5907
5942
|
this.decoderId = null;
|
|
5908
5943
|
await sourceBufferController.appendInit(
|
|
5909
5944
|
streamingSegment.initData,
|
|
@@ -5915,6 +5950,8 @@ var BufferingControllerImpl = class extends import_vinyl_util51.EventHostImpl {
|
|
|
5915
5950
|
await sourceBufferController.setTimestampOffset(
|
|
5916
5951
|
streamingSegment.timestampOffset
|
|
5917
5952
|
);
|
|
5953
|
+
} else if (reinitialized) {
|
|
5954
|
+
await sourceBufferController.setTimestampOffset(tail.endTime);
|
|
5918
5955
|
}
|
|
5919
5956
|
const maxAppendSize = this.getMaxAppendSize(
|
|
5920
5957
|
streamingSegment.quality.contentType
|
|
@@ -6306,7 +6343,7 @@ var MediaSourceControllerImpl = class extends import_vinyl_util54.EventHostImpl
|
|
|
6306
6343
|
"removing source buffer from media source",
|
|
6307
6344
|
mediaSource.readyState
|
|
6308
6345
|
);
|
|
6309
|
-
if (mediaSource.readyState !== "closed") {
|
|
6346
|
+
if (mediaSource.readyState !== "closed" && (0, import_vinyl_util54.indexOf)(mediaSource.sourceBuffers, sourceBuffer) !== -1) {
|
|
6310
6347
|
mediaSource.removeSourceBuffer(sourceBuffer);
|
|
6311
6348
|
}
|
|
6312
6349
|
this.sourceBuffers.delete(sourceBuffer);
|