@netless/app-slide 0.2.29 → 0.2.30-beta.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/main.es.js CHANGED
@@ -31160,7 +31160,7 @@ void main(void){
31160
31160
  }, this.playMediaFromCtrl = () => {
31161
31161
  this.ctx.isPlayerPaused() ? this.ctx.logger.info("Media controller prevent play event with paused state", this.ctx.taskId) : (this.ctx.mode !== "interactive" && this.playMedia(), this.ctx.mode !== "local" && this.ctx.eventHub.emit(ky.mediaPlay, { id: this.targetId, time: this.media.currentTime - this.start }));
31162
31162
  }, this.pauseMediaFromCtrl = () => {
31163
- this.ctx.isPlayerPaused() ? this.ctx.logger.info("Media controller prevent pause event with paused state", this.ctx.taskId) : (this.ctx.mode !== "interactive" && this.pauseMedia(), this.ctx.mode !== "local" && this.ctx.eventHub.emit(ky.mediaPause, { id: this.targetId, time: this.media.currentTime - this.start }));
31163
+ this.ctx.isPlayerPaused() ? this.ctx.logger.info("Media controller prevent pause event with paused state", this.ctx.taskId) : (this.ctx.mode !== "interactive" && this.pauseMedia(), this.ctx.mode === "local" || this.ctx.isRendering || this.ctx.eventHub.emit(ky.mediaPause, { id: this.targetId, time: this.media.currentTime - this.start }));
31164
31164
  }, this.onClickFullScreenButtonHandle = () => {
31165
31165
  this.media.requestFullscreen(), this.ctx.eventHub.emit(ky.fullscreenChange, { targetId: this.targetId, state: true });
31166
31166
  }, this.onClickCancelFullScreenButtonHandle = () => {
@@ -31376,7 +31376,7 @@ void main(void){
31376
31376
  };
31377
31377
  class r_ extends Za.a {
31378
31378
  constructor(t2) {
31379
- var e2, i2, n2, r2, o2, s2, a2;
31379
+ var e2, i2, n2, r2;
31380
31380
  super(), this.type = "video", this.sprite = new ep(), this.isPlaying = false, this.isGlobalPause = false, this.fullscreen = false, this.url = "", this.onVideoStalled = () => {
31381
31381
  this.ctx.logger.warn(this.url + ", Failed to fetch data, but trying.", this.ctx.taskId);
31382
31382
  }, this.updateVolume = (t3) => {
@@ -31385,18 +31385,18 @@ void main(void){
31385
31385
  const { targetId: e3, state: i3, slideIndex: n3 } = t3;
31386
31386
  n3 === this.ctx.slideIndex && e3 === this.id && (i3 ? this.requestFullscreen() : this.requestCancelFullscreen());
31387
31387
  }, this.id = t2.id, this.start = (e2 = t2.video.cut) === null || e2 === void 0 ? void 0 : e2.start, this.end = (i2 = t2.video.cut) === null || i2 === void 0 ? void 0 : i2.end, this.fullscreen = (n2 = t2.video.fullscreen) !== null && n2 !== void 0 && n2, this.container = t2.container, this.ctx = t2.ctx, this.ctx.medias[this.id] = this;
31388
- let l2 = t2.video.src;
31389
- this.ctx.loaderDelegate && (l2 = this.ctx.loaderDelegate.redirectMedia(l2), this.ctx.logger.info(`redirect media url from ${t2.video.src} to ${l2} by delegate.`, t2.ctx.taskId)), this.videoResource = new Vh.w(l2, { autoLoad: true, autoPlay: false, updateFPS: 30, crossorigin: true }), (r2 = this.videoElement) === null || r2 === void 0 || r2.addEventListener("stalled", this.onVideoStalled), this.url = t2.video.src;
31390
- let h2 = t2.video.src.replace(/4$/, "3");
31391
- this.ctx.loaderDelegate && (h2 = this.ctx.loaderDelegate.redirectMedia(h2), this.ctx.logger.info(`redirect media url from ${t2.video.src.replace(/4$/, "3")} to ${h2} by delegate.`, t2.ctx.taskId)), this.rtcAudio = new i_(h2, t2.ctx.runningAudio);
31392
- const { video: u2, width: c2, height: d2, target: p2 } = t2;
31393
- this.controller = new t_({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, width: c2, height: d2, target: p2, media: this, info: u2, canvasElement: t2.canvasElement }), this.controller.addPlayCallBack(() => {
31394
- this.sprite.width = c2, this.sprite.height = d2, this.ctx.clock.setTimeout(() => {
31388
+ let o2 = t2.video.src;
31389
+ this.ctx.loaderDelegate && (o2 = this.ctx.loaderDelegate.redirectMedia(o2), this.ctx.logger.info(`redirect media url from ${t2.video.src} to ${o2} by delegate.`, t2.ctx.taskId)), this.videoResource = new Vh.w(o2, { autoLoad: true, autoPlay: false, updateFPS: 30, crossorigin: true }), (r2 = this.videoElement) === null || r2 === void 0 || r2.addEventListener("stalled", this.onVideoStalled), this.url = t2.video.src;
31390
+ let s2 = t2.video.src.replace(/4$/, "3");
31391
+ this.ctx.loaderDelegate && (s2 = this.ctx.loaderDelegate.redirectMedia(s2), this.ctx.logger.info(`redirect media url from ${t2.video.src.replace(/4$/, "3")} to ${s2} by delegate.`, t2.ctx.taskId)), this.rtcAudio = new i_(s2, t2.ctx.runningAudio);
31392
+ const { video: a2, width: l2, height: h2, target: u2 } = t2;
31393
+ this.controller = new t_({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, width: l2, height: h2, target: u2, media: this, info: a2, canvasElement: t2.canvasElement }), this.controller.addPlayCallBack(() => {
31394
+ this.sprite.width = l2, this.sprite.height = h2, this.ctx.clock.setTimeout(() => {
31395
31395
  this.sprite.visible = true;
31396
31396
  }, 50);
31397
31397
  });
31398
- const f2 = new Vh.c(null, { height: d2, width: c2 });
31399
- f2.resource = this.videoResource, this.videoResource.bind(f2), this.sprite = new ep(), this.sprite.visible = false, this.sprite.texture = new Vh.t(f2), this.sprite.interactive = true, this.container.addChild(this.sprite), this.sprite.on("mouseover", (t3) => {
31398
+ const c2 = new Vh.c(null, { height: h2, width: l2 });
31399
+ c2.resource = this.videoResource, this.videoResource.bind(c2), this.sprite = new ep(), this.sprite.visible = false, this.sprite.texture = new Vh.t(c2), this.sprite.interactive = true, this.container.addChild(this.sprite), this.sprite.on("mouseover", (t3) => {
31400
31400
  t3.stopPropagation(), this.controller.show();
31401
31401
  }), this.sprite.on("mouseout", (t3) => {
31402
31402
  t3.stopPropagation(), this.controller.hide();
@@ -31405,12 +31405,6 @@ void main(void){
31405
31405
  (e3 = this.videoElement) === null || e3 === void 0 || e3.addEventListener(t3, () => {
31406
31406
  t3 === "timeupdate" && this.isPlaying, this.emit(t3);
31407
31407
  });
31408
- }), (o2 = this.videoElement) === null || o2 === void 0 || o2.addEventListener("playing", () => {
31409
- this.rtcAudio.play();
31410
- }), (s2 = this.videoElement) === null || s2 === void 0 || s2.addEventListener("pause", () => {
31411
- console.log("video pause");
31412
- }), (a2 = this.videoElement) === null || a2 === void 0 || a2.addEventListener("stalled", () => {
31413
- console.log("video stalled");
31414
31408
  }), this.ctx.activeMedia.add(this), this.ctx.volumeAdjuster.on("update", this.updateVolume), this.ctx.globalEventHub.on("syncFullscreenVideoState", this.syncFullscreenVideoState);
31415
31409
  }
31416
31410
  get videoElement() {
@@ -33344,7 +33338,7 @@ void main(void){
33344
33338
  createCtx(t2) {
33345
33339
  const { task: e2 } = this.stageStates[t2];
33346
33340
  e2.addMTask(() => Py(this, void 0, void 0, function* () {
33347
- const e3 = new Gm(this.loader), i2 = new Za.a(), n2 = { taskId: this.taskId, mode: this.mode, renderer: this.renderer, graphicsTexture: new Km(), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new $m(i2), eventHub: i2, view: this.view, medias: /* @__PURE__ */ Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new Qm(), clock: this.clock, spriteTexture: e3, slideIndex: t2, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false, slideScopeEventHub: new Za.a(), logger: this.logger, sdfManager: this.sdfManager, loaderDelegate: this.loaderDelegate, runningAudio: this.runningAudio, activeMedia: this.activeMedia, isPlayerPaused: this.isPlayerPaused, timingEventHub: new Za.a(), maxResolution: this.maxResolution, animatedIds: /* @__PURE__ */ new Set(), volumeAdjuster: this.volumeAdjuster, forceCanvas: this.forceCanvas, globalEventHub: this.globalEventHub };
33341
+ const e3 = new Gm(this.loader), i2 = new Za.a(), n2 = { taskId: this.taskId, mode: this.mode, renderer: this.renderer, graphicsTexture: new Km(), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new $m(i2), eventHub: i2, view: this.view, medias: /* @__PURE__ */ Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new Qm(), clock: this.clock, spriteTexture: e3, slideIndex: t2, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false, slideScopeEventHub: new Za.a(), logger: this.logger, sdfManager: this.sdfManager, loaderDelegate: this.loaderDelegate, runningAudio: this.runningAudio, activeMedia: this.activeMedia, isPlayerPaused: this.isPlayerPaused, timingEventHub: new Za.a(), maxResolution: this.maxResolution, animatedIds: /* @__PURE__ */ new Set(), volumeAdjuster: this.volumeAdjuster, forceCanvas: this.forceCanvas, globalEventHub: this.globalEventHub, isRendering: false };
33348
33342
  this.stageCtxs[t2] = n2;
33349
33343
  }), "@StagePool[createCtx]");
33350
33344
  }
@@ -33688,7 +33682,7 @@ void main(void){
33688
33682
  const r2 = yield this.stagePool.getStage(t2), o2 = `snapshot-${t2}-${this.isForward ? "start" : "end"}`, s2 = yield this.localStorage.getItem(o2);
33689
33683
  if (!r2)
33690
33684
  return;
33691
- this.translateEvent(r2.ctx.eventHub, [ky.mainSeqStepChange, ky.mainSeqStateChange, ky.hyperlinkTrigger, ky.interactiveSeqAction, ky.mainSeqStepStart, ky.mainSeqStepEnd, ky.animateStart, ky.animateEnd, ky.mediaPlay, ky.mediaPause, ky.mediaSeek, ky.mediaStop, ky.requestGotoSlide, ky.requestNextSlide, ky.requestPrevSlide, ky.interactiveSeqStateChange, ky.userInput, ky.fullscreenChange]), this.currentIndex = Number(t2);
33685
+ r2.ctx.isRendering = true, this.translateEvent(r2.ctx.eventHub, [ky.mainSeqStepChange, ky.mainSeqStateChange, ky.hyperlinkTrigger, ky.interactiveSeqAction, ky.mainSeqStepStart, ky.mainSeqStepEnd, ky.animateStart, ky.animateEnd, ky.mediaPlay, ky.mediaPause, ky.mediaSeek, ky.mediaStop, ky.requestGotoSlide, ky.requestNextSlide, ky.requestPrevSlide, ky.interactiveSeqStateChange, ky.userInput, ky.fullscreenChange]), this.currentIndex = Number(t2);
33692
33686
  const { width: a2, height: l2, slideCount: h2 } = r2.json;
33693
33687
  this.slideCount = h2, this.designWidth = a2, this.designHeight = l2, (e2 = this.currentStage) === null || e2 === void 0 || e2.clearOnSlideChange();
33694
33688
  const u2 = this.currentStage;
@@ -33711,7 +33705,7 @@ void main(void){
33711
33705
  }
33712
33706
  (n2 = this.transactionPlayer) === null || n2 === void 0 || n2.dispose();
33713
33707
  }
33714
- this.isForward ? yield r2.startTiming() : r2.setMainSeqApplied(), r2.ctx.slideScopeEventHub.emit("slide-render", r2.ctx.slideIndex), this.emit(ky.renderEnd, t2), this.emit(ky.slideChange, t2), this.preload(t2 + 1).catch((e3) => {
33708
+ this.isForward ? yield r2.startTiming() : r2.setMainSeqApplied(), r2.ctx.slideScopeEventHub.emit("slide-render", r2.ctx.slideIndex), this.emit(ky.renderEnd, t2), this.emit(ky.slideChange, t2), r2.ctx.isRendering = false, this.preload(t2 + 1).catch((e3) => {
33715
33709
  this.errorChannel.emit("error", Tm.transform(e3), t2 + 1);
33716
33710
  }), this.preload(t2 - 1).catch((e3) => {
33717
33711
  this.errorChannel.emit("error", Tm.transform(e3), t2 - 1);
@@ -35626,9 +35620,9 @@ void main(void){
35626
35620
  }
35627
35621
  var aT = { syncDispatch: "syncDispatch", syncReceive: "syncReceive", syncEventLag: "syncEventLag", renderStart: "renderStart", renderEnd: "renderEnd", renderError: "renderError", slideChange: "slideChange", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", animateStart: "animateStart", animateEnd: "animateEnd", stateChange: "stateChange", slideStepEnd: "slideEnd", slideStepStart: "slideStart" }, lT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, hT = "";
35628
35622
  try {
35629
- hT = "0.10.1-beta";
35623
+ hT = "0.10.1";
35630
35624
  } catch (t2) {
35631
- hT = "-dev";
35625
+ hT = "dev";
35632
35626
  }
35633
35627
  var uT = null;
35634
35628
  try {
@@ -38691,7 +38685,7 @@ class SlidePreviewer {
38691
38685
  }
38692
38686
  }
38693
38687
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
38694
- const version = "0.2.29";
38688
+ const version = "0.2.30-beta.1";
38695
38689
  const SlideApp = {
38696
38690
  kind: "Slide",
38697
38691
  setup(context) {