@netless/app-slide 0.2.19 → 0.2.21

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
@@ -30840,7 +30840,7 @@ void main(void){
30840
30840
  t3.stopPropagation(), this.mediaController.style.display = "none";
30841
30841
  }, this.mediaTimeUpdate = () => Fv(this, void 0, void 0, function* () {
30842
30842
  const t3 = this.media.currentTime - this.start;
30843
- if (this.duration > 0 && (t3 > this.duration || this.media.ended) && (yield this.pauseMedia(), this.medianIsEnd = true, this.ctx.eventHub.emit(by.mediaStop, { id: this.targetId })), this.currentTime.innerText = Uv.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), !this.bookmarkList || this.bookmarkList.length === 0)
30843
+ if (this.duration > 0 && (t3 > this.duration || this.media.ended) && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(by.mediaStop, { id: this.targetId })), this.currentTime.innerText = Uv.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), !this.bookmarkList || this.bookmarkList.length === 0)
30844
30844
  return;
30845
30845
  const e3 = this.bookmarkList[this.pickBookmarkIndex];
30846
30846
  e3 && e3.time.toFixed(0) === this.media.currentTime.toFixed(0) && (this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${e3.name}`), this.pickBookmarkIndex += 1);
@@ -30956,8 +30956,10 @@ void main(void){
30956
30956
  var kv = i(115);
30957
30957
  class Gv extends Ja.a {
30958
30958
  constructor(t2, e2) {
30959
- super(), this.isGlobalPause = false, this.lastTime = -1, this.howl = null, this.rctClient = null, this.isHowlEnd = false, this.url = t2, this.runningAudio = e2, Ty.RtcAudioClazz ? (this.rctClient = new Ty.RtcAudioClazz(t2), this.rctClient.on("load", () => this.emit("load")), this.rctClient.on("pause", () => this.emit("pause")), this.rctClient.on("play", () => this.emit("play"))) : (this.howl = new kv.Howl({ src: [t2] }), this.howl.on("load", () => this.emit("load")), this.howl.on("pause", () => this.emit("pause")), this.howl.on("play", () => {
30960
- this.isHowlEnd = false, this.emit("play");
30959
+ super(), this.isGlobalPause = false, this.lastTime = -1, this.howl = null, this.rctClient = null, this.isHowlEnd = false, this.isHowlLoadEmit = false, this.url = t2, this.runningAudio = e2, Ty.RtcAudioClazz ? (this.rctClient = new Ty.RtcAudioClazz(t2), this.rctClient.on("load", () => this.emit("load")), this.rctClient.on("pause", () => this.emit("pause")), this.rctClient.on("play", () => this.emit("play"))) : (this.howl = new kv.Howl({ src: [t2] }), this.howl.load(), this.howl.on("load", () => {
30960
+ this.isHowlLoadEmit = true, this.emit("load");
30961
+ }), this.howl.on("pause", () => this.emit("pause")), this.howl.on("play", () => {
30962
+ this.isHowlLoadEmit || this.emit("load"), this.isHowlEnd = false, this.emit("play");
30961
30963
  }), this.howl.on("end", () => {
30962
30964
  this.isHowlEnd = true;
30963
30965
  }));
@@ -31091,7 +31093,7 @@ void main(void){
31091
31093
  return !!(t3 && t3.videoWidth > 0);
31092
31094
  }, 3e3);
31093
31095
  const e2 = this.videoResource.source;
31094
- e2 && e2.videoWidth <= 0 || (Ty.RtcAudioClazz ? (this.videoResource.source.volume = 0, this.rtcAudio.once("play", () => {
31096
+ e2 && e2.videoWidth <= 0 || (Ty.RtcAudioClazz ? (this.videoResource.source.volume = 0, this.videoResource.source.muted = true, this.rtcAudio.once("play", () => {
31095
31097
  var t3;
31096
31098
  (t3 = this.videoResource.source) === null || t3 === void 0 || t3.play();
31097
31099
  }), this.rtcAudio.play()) : yield (t2 = this.videoResource.source) === null || t2 === void 0 ? void 0 : t2.play());
@@ -31158,7 +31160,7 @@ void main(void){
31158
31160
  this.audioPlayer.volume(t3);
31159
31161
  }, this.id = t2.id;
31160
31162
  let e2 = t2.audio.src;
31161
- t2.ctx.loaderDelegate && (e2 = t2.ctx.loaderDelegate.redirectMedia(e2), t2.ctx.logger.info(`redirect media url from ${t2.audio.src} to ${e2} by delegate.`, t2.ctx.taskId)), this.audioPlayer = new Gv(e2, t2.ctx.runningAudio), t2.audio.cut && (this.start = t2.audio.cut.start, this.end = t2.audio.cut.end), this.ctx = t2.ctx, this.ctx.medias[this.id] = this;
31163
+ /mp4$/.test(e2) && (e2 = e2.replace(/mp4$/, "mp3")), t2.ctx.loaderDelegate && (e2 = t2.ctx.loaderDelegate.redirectMedia(e2), t2.ctx.logger.info(`redirect media url from ${t2.audio.src} to ${e2} by delegate.`, t2.ctx.taskId)), this.audioPlayer = new Gv(e2, t2.ctx.runningAudio), t2.audio.cut && (this.start = t2.audio.cut.start, this.end = t2.audio.cut.end), this.ctx = t2.ctx, this.ctx.medias[this.id] = this;
31162
31164
  const { width: i2, height: n2, target: r2 } = t2;
31163
31165
  this.controller = new Uv({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, height: n2, width: i2, target: r2, media: this, info: t2.audio, canvasElement: t2.canvasElement }), this.audioPlayer.on("load", () => this.emit("durationchange")), this.audioPlayer.on("timeupdate", () => this.emit("timeupdate")), this.audioPlayer.on("pause", () => this.emit("pause")), this.audioPlayer.on("play", () => this.emit("play")), this.ctx.activeMedia.add(this), this.ctx.volumeAdjuster.on("update", this.updateVolume);
31164
31166
  }
@@ -33189,7 +33191,7 @@ void main(void){
33189
33191
  this.runtime.drawCall = this.drawCall, this.runtime.fps = Math.floor(this.app.ticker.minFPS), this.drawCall = 0;
33190
33192
  }, null, Rh.c.LOW), this.clock = new Mm(this.app.ticker), this.objPoolGroup = ym(), this.stagePool = new my(this.loader, this.mode, this.app.renderer, this.app.ticker, this.app.view, this.clock, this.objPoolGroup, this.errorChannel, this.localStorage, this.logger, t2.loadDelegate, this.isPlayerPaused, this.maxResolution, this.volumeAdjuster, this.config.forceCanvas), this.app.view.addEventListener("webglcontextlost", this.onWebGLLost);
33191
33193
  try {
33192
- this.transactionPlayer = new Eh();
33194
+ this.config.forceCanvas || (this.transactionPlayer = new Eh());
33193
33195
  } catch (t3) {
33194
33196
  /Error creating WebGL context/.test(t3.message) ? this.errorChannel.emit("error", new fm(lm.CanvasCrash, "webgl context lost.")) : this.errorChannel.emit("error", new fm(lm.RuntimeWarn, t3.message));
33195
33197
  }
@@ -35174,9 +35176,9 @@ void main(void){
35174
35176
  }
35175
35177
  var Vb = { 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" }, Xb = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, Wb = "";
35176
35178
  try {
35177
- Wb = "0.7.8-legacy-beta";
35179
+ Wb = "0.8.1";
35178
35180
  } catch (t2) {
35179
- Wb = "dev--legacy";
35181
+ Wb = "dev";
35180
35182
  }
35181
35183
  var Yb = null;
35182
35184
  try {
@@ -35353,7 +35355,7 @@ void main(void){
35353
35355
  r2.__slideState.mediaState[t4.id] = e4, r2.emitSyncDispatch({ slideIndex: r2.__slideState.currentSlideIndex, type: "mediaPause", id: t4.id, state: e4 }), r2.emitStateChange();
35354
35356
  }), o2.on(by.mediaSeek, function(t4) {
35355
35357
  var e4 = { type: "pause", time: 0 };
35356
- t4.isPlaying ? (e4.type = "play", r2.__slideState.mediaState[t4.id] ? e4.time = r2.__slideState.mediaState[t4.id].time - 1e3 * t4.time : e4.time = r2.timestamp() - 1e3 * t4.time, r2.__slideState.mediaState[t4.id] = e4) : (e4.type = "pause", e4.time = t4.time, r2.__slideState.mediaState[t4.id] = e4), r2.emitSyncDispatch({ slideIndex: r2.__slideState.currentSlideIndex, type: "mediaSeek", id: t4.id, time: t4.time, state: e4 }), r2.emitStateChange();
35358
+ t4.isPlaying ? (e4.type = "play", e4.time = r2.timestamp() - 1e3 * t4.time, r2.__slideState.mediaState[t4.id] = e4) : (e4.type = "pause", e4.time = t4.time, r2.__slideState.mediaState[t4.id] = e4), r2.emitSyncDispatch({ slideIndex: r2.__slideState.currentSlideIndex, type: "mediaSeek", id: t4.id, time: t4.time, state: e4 }), r2.emitStateChange();
35357
35359
  }), o2.on(by.requestPrevSlide, function(t4) {
35358
35360
  r2.handlePrevSlide(t4);
35359
35361
  }), o2.on(by.requestNextSlide, function(t4) {
@@ -38064,7 +38066,7 @@ class SlidePreviewer {
38064
38066
  }
38065
38067
  }
38066
38068
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
38067
- const version = "0.2.19";
38069
+ const version = "0.2.21";
38068
38070
  const SlideApp = {
38069
38071
  kind: "Slide",
38070
38072
  setup(context) {