@amazon/vinyl 3.0.0 → 3.0.1

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 CHANGED
@@ -2775,7 +2775,7 @@ function configureVinylGlobal(options) {
2775
2775
  var import_vinyl_util27 = require("@amazon/vinyl-util");
2776
2776
  var vinylVersion = /* @__PURE__ */ (0, import_vinyl_util27.parseVersion)(
2777
2777
  /* istanbul ignore next */
2778
- "3.0.0"
2778
+ "3.0.1"
2779
2779
  );
2780
2780
 
2781
2781
  // src/global/globalRef.ts
@@ -9929,36 +9929,36 @@ var TrackControllerImpl = class extends import_vinyl_util101.EventHostImpl {
9929
9929
  (0, import_vinyl_util101.logDebug)(this, "more adbreaks");
9930
9930
  return;
9931
9931
  }
9932
- if (adParent.active) {
9933
- (0, import_vinyl_util101.logDebug)(this, "no ads began");
9934
- return;
9935
- }
9936
9932
  const adParentLoad = this._current;
9937
9933
  const placement = event.adBreak.placement;
9938
9934
  const isPreroll = placement === "preroll";
9939
9935
  const isPostroll = placement === "postroll";
9936
+ const noAdBegan = adParent.active;
9937
+ const resumeContent = (startTime) => this.setCurrentTrack(adParent, {
9938
+ config: __spreadProps(__spreadValues({}, adParentLoad.config), { startTime }),
9939
+ isAd: false,
9940
+ checkPreroll: false
9941
+ });
9940
9942
  if (isPostroll) {
9941
9943
  (0, import_vinyl_util101.logDebug)(this, "trackEnded after postroll");
9942
9944
  this.dispatch("trackEnded", { track: adParentLoad });
9943
- }
9944
- if (isPostroll && this.hasNext()) {
9945
- this.next();
9946
- } else {
9947
- const startTime = isPreroll ? (_a = adParentLoad.config) == null ? void 0 : _a.startTime : event.resumePosition;
9948
- this.setCurrentTrack(adParent, {
9949
- config: __spreadProps(__spreadValues({}, adParentLoad.config), {
9950
- startTime
9951
- }),
9952
- isAd: false,
9953
- checkPreroll: false
9954
- });
9955
- if (isPostroll) {
9956
- (0, import_vinyl_util101.logInfo)(this, "queueEnded after postroll ad(s)");
9957
- this.dispatch("queueEnded", {});
9958
- } else {
9959
- playbackController.play().catch(import_vinyl_util101.noop);
9945
+ if (this.hasNext()) {
9946
+ this.next();
9947
+ return;
9960
9948
  }
9949
+ if (!noAdBegan) resumeContent(event.resumePosition);
9950
+ (0, import_vinyl_util101.logInfo)(this, "queueEnded after postroll");
9951
+ this.dispatch("queueEnded", {});
9952
+ return;
9961
9953
  }
9954
+ if (noAdBegan) {
9955
+ (0, import_vinyl_util101.logDebug)(this, "no ads began");
9956
+ return;
9957
+ }
9958
+ resumeContent(
9959
+ isPreroll ? (_a = adParentLoad.config) == null ? void 0 : _a.startTime : event.resumePosition
9960
+ );
9961
+ playbackController.play().catch(import_vinyl_util101.noop);
9962
9962
  })
9963
9963
  );
9964
9964
  }