@netless/app-slide 0.2.53-alpha.2 → 0.2.53-alpha.3

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
@@ -31258,7 +31258,7 @@ void main(void){
31258
31258
  t3.stopPropagation(), this.hide();
31259
31259
  }, this.mediaTimeUpdate = () => o_(this, void 0, void 0, function* () {
31260
31260
  const t3 = this.media.currentTime - this.start;
31261
- if (this.duration > 0 && (Math.abs(t3 - this.duration) < 0.3 || t3 > this.duration) && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(zy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = l_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31261
+ if (console.log("duration", this.duration, "current", t3), this.duration > 0 && (Math.abs(t3 - this.duration) < 0.3 || t3 > this.duration) && (yield this.onStopPlay(), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = l_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31262
31262
  const t4 = this.bookmarkList[this.pickBookmarkIndex];
31263
31263
  t4 && t4.time.toFixed(0) === this.media.currentTime.toFixed(0) && (this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${t4.name}`), this.pickBookmarkIndex += 1);
31264
31264
  }
@@ -31360,6 +31360,11 @@ void main(void){
31360
31360
  const e2 = document.createElement("div");
31361
31361
  s_(e2, { background: "#D9D9D9", position: "relative", height: "10px", display: "flex" }), this.progress.appendChild(e2), s_(this.currentProgress, { background: "#4F4F4F", top: "0px", left: "0", height: "10px", flex: "0" }), e2.appendChild(this.currentProgress);
31362
31362
  }
31363
+ onStopPlay() {
31364
+ return o_(this, void 0, void 0, function* () {
31365
+ yield this.pauseMedia(), this.media.localPause(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(zy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle();
31366
+ });
31367
+ }
31363
31368
  fadeHit(t2) {
31364
31369
  if (!this.info.fade)
31365
31370
  return;
@@ -31614,13 +31619,29 @@ void main(void){
31614
31619
  pause() {
31615
31620
  return c_(this, void 0, void 0, function* () {
31616
31621
  return new Promise((t2) => {
31617
- this.isPlaying = false, this.ctx.logger.warn(this.url + ", pause video manual.", this.ctx.taskId), this.ctx.logger.warn(this.url + ", pause rtc audio manual.", this.ctx.taskId), this.rtcAudio.on("pause", () => {
31618
- var e2;
31619
- (e2 = this.videoElement) === null || e2 === void 0 || e2.pause(), t2();
31620
- }), this.rtcAudio.pause();
31622
+ this.isPlaying = false, this.ctx.logger.warn(this.url + ", pause video manual.", this.ctx.taskId), this.ctx.logger.warn(this.url + ", pause rtc audio manual.", this.ctx.taskId);
31623
+ const e2 = new Promise(() => {
31624
+ this.rtcAudio.once("pause", () => {
31625
+ t2();
31626
+ });
31627
+ });
31628
+ this.rtcAudio.pause();
31629
+ const i2 = new Promise(() => {
31630
+ setTimeout(() => {
31631
+ t2();
31632
+ }, 500);
31633
+ });
31634
+ return Promise.race([e2, i2]).then(() => {
31635
+ var t3;
31636
+ (t3 = this.videoElement) === null || t3 === void 0 || t3.pause();
31637
+ });
31621
31638
  });
31622
31639
  });
31623
31640
  }
31641
+ localPause() {
31642
+ var t2;
31643
+ (t2 = this.videoElement) === null || t2 === void 0 || t2.pause();
31644
+ }
31624
31645
  globalPause() {
31625
31646
  this.isPlaying && (this.isGlobalPause = true, this.pause());
31626
31647
  }
@@ -31730,6 +31751,9 @@ void main(void){
31730
31751
  this.ctx.isPlayerPaused() ? this.ctx.logger.info("Audio player prevent pause event with paused state", this.ctx.taskId) : (this.isPlaying = false, this.audioPlayer.pause());
31731
31752
  });
31732
31753
  }
31754
+ localPause() {
31755
+ this.audioPlayer.pause();
31756
+ }
31733
31757
  globalPause() {
31734
31758
  this.isPlaying && (this.isGlobalPause = true, this.pause());
31735
31759
  }
@@ -36014,7 +36038,7 @@ void main(void){
36014
36038
  }
36015
36039
  var fT = { 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" }, mT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, gT = "";
36016
36040
  try {
36017
- gT = "1.2.2-alpha.1";
36041
+ gT = "1.2.2-alpha.4";
36018
36042
  } catch (t2) {
36019
36043
  gT = "dev -";
36020
36044
  }
@@ -39167,7 +39191,7 @@ class SlidePreviewer {
39167
39191
  }
39168
39192
  }
39169
39193
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39170
- const version = "0.2.53-alpha.2";
39194
+ const version = "0.2.53-alpha.3";
39171
39195
  const SlideApp = {
39172
39196
  kind: "Slide",
39173
39197
  setup(context) {