@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.js CHANGED
@@ -2565,7 +2565,7 @@ function configureVinylGlobal(options) {
2565
2565
  import { parseVersion } from "@amazon/vinyl-util";
2566
2566
  var vinylVersion = /* @__PURE__ */ parseVersion(
2567
2567
  /* istanbul ignore next */
2568
- "3.0.0"
2568
+ "3.0.1"
2569
2569
  );
2570
2570
 
2571
2571
  // src/global/globalRef.ts
@@ -9996,36 +9996,36 @@ var TrackControllerImpl = class extends EventHostImpl17 {
9996
9996
  logDebug17(this, "more adbreaks");
9997
9997
  return;
9998
9998
  }
9999
- if (adParent.active) {
10000
- logDebug17(this, "no ads began");
10001
- return;
10002
- }
10003
9999
  const adParentLoad = this._current;
10004
10000
  const placement = event.adBreak.placement;
10005
10001
  const isPreroll = placement === "preroll";
10006
10002
  const isPostroll = placement === "postroll";
10003
+ const noAdBegan = adParent.active;
10004
+ const resumeContent = (startTime) => this.setCurrentTrack(adParent, {
10005
+ config: __spreadProps(__spreadValues({}, adParentLoad.config), { startTime }),
10006
+ isAd: false,
10007
+ checkPreroll: false
10008
+ });
10007
10009
  if (isPostroll) {
10008
10010
  logDebug17(this, "trackEnded after postroll");
10009
10011
  this.dispatch("trackEnded", { track: adParentLoad });
10010
- }
10011
- if (isPostroll && this.hasNext()) {
10012
- this.next();
10013
- } else {
10014
- const startTime = isPreroll ? (_a = adParentLoad.config) == null ? void 0 : _a.startTime : event.resumePosition;
10015
- this.setCurrentTrack(adParent, {
10016
- config: __spreadProps(__spreadValues({}, adParentLoad.config), {
10017
- startTime
10018
- }),
10019
- isAd: false,
10020
- checkPreroll: false
10021
- });
10022
- if (isPostroll) {
10023
- logInfo3(this, "queueEnded after postroll ad(s)");
10024
- this.dispatch("queueEnded", {});
10025
- } else {
10026
- playbackController.play().catch(noop9);
10012
+ if (this.hasNext()) {
10013
+ this.next();
10014
+ return;
10027
10015
  }
10016
+ if (!noAdBegan) resumeContent(event.resumePosition);
10017
+ logInfo3(this, "queueEnded after postroll");
10018
+ this.dispatch("queueEnded", {});
10019
+ return;
10028
10020
  }
10021
+ if (noAdBegan) {
10022
+ logDebug17(this, "no ads began");
10023
+ return;
10024
+ }
10025
+ resumeContent(
10026
+ isPreroll ? (_a = adParentLoad.config) == null ? void 0 : _a.startTime : event.resumePosition
10027
+ );
10028
+ playbackController.play().catch(noop9);
10029
10029
  })
10030
10030
  );
10031
10031
  }