@netless/app-slide 0.2.81 → 0.2.82

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
@@ -30341,7 +30341,7 @@ void main(void){
30341
30341
  t3.pivot.x > o2 && (o2 = t3.pivot.x), t3.pivot.y > s2 && (s2 = t3.pivot.y);
30342
30342
  const a2 = new Nh.d();
30343
30343
  a2.translate(o2, s2);
30344
- const l2 = Vh.p.create({ width: i2 ? r2.width : n2, height: i2 ? Math.max(e2, t2) : r2.height, resolution: 0.5 });
30344
+ const l2 = Vh.p.create({ width: i2 ? r2.width : n2, height: i2 ? Math.max(e2, t2) : r2.height, resolution: 2 });
30345
30345
  return this.ctx.renderer.render(this.effectContainer, { renderTexture: l2, transform: a2 }), { texture: l2, offsetX: o2, offsetY: s2 };
30346
30346
  }
30347
30347
  createStrokeFill() {
@@ -30879,6 +30879,8 @@ void main(void){
30879
30879
  if (1 !== t2.length)
30880
30880
  return false;
30881
30881
  const e2 = t2[0].path.trim().split(" "), i2 = [], n2 = [];
30882
+ if (e2.length < 4)
30883
+ return false;
30882
30884
  for (let t3 = 0; t3 < e2.length; t3 += 2) {
30883
30885
  const r3 = e2[t3], o3 = e2[t3 + 1], [s3, a2] = o3.split(",").map((t4) => Number(t4) / 100);
30884
30886
  i2.push(r3), n2.push({ x: s3, y: a2 });
@@ -31076,7 +31078,7 @@ void main(void){
31076
31078
  const n2 = new Nh.d();
31077
31079
  if (n2.translate(e2, i2), 0 === this.effectContainer.children.length)
31078
31080
  return null;
31079
- const r2 = Vh.p.create({ width: t2.width, height: t2.height, resolution: 0.5 });
31081
+ const r2 = Vh.p.create({ width: t2.width, height: t2.height, resolution: Math.min(this.ctx.renderer.resolution, window.devicePixelRatio || 2, 2) });
31080
31082
  return this.ctx.renderer.render(this.effectContainer, { renderTexture: r2, transform: n2 }), { texture: r2, offsetX: e2, offsetY: i2 };
31081
31083
  }
31082
31084
  createStrokeGraphics() {
@@ -31330,7 +31332,7 @@ void main(void){
31330
31332
  t3.stopPropagation(), this.hide();
31331
31333
  }, this.mediaTimeUpdate = () => a_(this, void 0, void 0, function* () {
31332
31334
  const t3 = this.media.currentTime - this.start;
31333
- 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(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = u_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31335
+ if (console.log(t3, this.duration), !this.media.isUsedRemixAudio && this.duration < 0.5 ? this.duration > 0 && t3 >= this.duration && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()) : 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(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = u_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31334
31336
  const t4 = this.bookmarkList[this.pickBookmarkIndex];
31335
31337
  t4 && t4.time.toFixed(0) === this.media.currentTime.toFixed(0) && (this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${t4.name}`), this.pickBookmarkIndex += 1);
31336
31338
  }
@@ -31533,6 +31535,9 @@ void main(void){
31533
31535
  this.isPaused || this.startTimeChangeEmit();
31534
31536
  }, 300);
31535
31537
  }
31538
+ isUsedRemixAudio() {
31539
+ return !!this.rctClient || !!this.domAudio;
31540
+ }
31536
31541
  play() {
31537
31542
  var t2, e2, i2, n2;
31538
31543
  this.runningAudio.has(this.url) && (null === (t2 = this.runningAudio.get(this.url)) || void 0 === t2 || t2.stop(), this.runningAudio.delete(this.url)), this.isHowlEnd = false, this.lastTime = -1, null === (e2 = this.howl) || void 0 === e2 || e2.play(this.staticEventId), null === (i2 = this.rctClient) || void 0 === i2 || i2.play(), null === (n2 = this.domAudio) || void 0 === n2 || n2.play(), this.runningAudio.set(this.url, this);
@@ -31603,6 +31608,10 @@ void main(void){
31603
31608
  get videoElement() {
31604
31609
  return this.videoResource.source;
31605
31610
  }
31611
+ get isUsedRemixAudio() {
31612
+ var t2, e2;
31613
+ return null !== (e2 = null === (t2 = this.rtcAudio) || void 0 === t2 ? void 0 : t2.isUsedRemixAudio()) && void 0 !== e2 && e2;
31614
+ }
31606
31615
  get currentTime() {
31607
31616
  var t2, e2;
31608
31617
  return null !== (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.currentTime) && void 0 !== e2 ? e2 : 0;
@@ -31773,6 +31782,10 @@ void main(void){
31773
31782
  const { width: r2, height: o2, target: s2 } = t2;
31774
31783
  this.controller = new u_({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, height: o2, width: r2, target: s2, 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);
31775
31784
  }
31785
+ get isUsedRemixAudio() {
31786
+ var t2, e2;
31787
+ return null !== (e2 = null === (t2 = this.audioPlayer) || void 0 === t2 ? void 0 : t2.isUsedRemixAudio()) && void 0 !== e2 && e2;
31788
+ }
31776
31789
  get currentTime() {
31777
31790
  return this.audioPlayer.currentTime;
31778
31791
  }
@@ -33694,7 +33707,7 @@ void main(void){
33694
33707
  insertCustomLinks(t2, e2) {
33695
33708
  return e2 && e2.length ? (e2.forEach((e3) => {
33696
33709
  let i2;
33697
- i2 = e3.shapeId.startsWith("master") ? t2.children[1] : e3.shapeId.startsWith("layout") ? t2.children[2] : t2.children[3], i2 || this.logger.error("Cannot find scope for custom link " + e3.shapeId, this.taskId), this.insertCustomLinksFromScope(i2.children, e3);
33710
+ i2 = e3.shapeId.startsWith("master") ? t2.children[1] : e3.shapeId.startsWith("layout") ? t2.children[2] : t2.children[3], i2 ? this.insertCustomLinksFromScope(i2.children, e3) : this.logger.error("Cannot find scope for custom link " + e3.shapeId, this.taskId);
33698
33711
  }), t2) : t2;
33699
33712
  }
33700
33713
  createStage(t2) {
@@ -34026,9 +34039,9 @@ void main(void){
34026
34039
  this.logger.error("removeChild error: PPTPlayer:1062", this.taskId);
34027
34040
  }
34028
34041
  this.globalEventHub.emit("onFullscreenChange", { status: false, slideIndex: this.currentIndex, targetId: null === (e3 = this.currentStage) || void 0 === e3 ? void 0 : e3.ctx.latestChangeFullscreenTargetId }), this.clearFullscreenEventListenersWithAppView(), t3 && this.emit(Xy.changeLocalFullscreenState, { status: false, slideIndex: this.currentIndex, targetId: null === (i3 = this.currentStage) || void 0 === i3 ? void 0 : i3.ctx.latestChangeFullscreenTargetId });
34029
- }, this.logger = t2.logger, this.tracker = t2.tracker, this.mode = t2.mode, this.volumeAdjuster = t2.volumeAdjuster, this.localStorage = new Gy(this.logger), this.cachedExtract = new jy(this.localStorage), this.enableWebAudio = !!$a()(t2.enableWebAudio) || t2.enableWebAudio, this.enableAutoForward = !$a()(t2.enableAutoForward) && t2.enableAutoForward, this.config = { minFPS: $a()(e2.minFPS) ? 30 : e2.minFPS, maxFPS: $a()(e2.maxFPS) ? 40 : e2.maxFPS, resolution: $a()(e2.resolution) ? 1 : e2.resolution, autoFPS: !$a()(e2.autoFPS) && e2.autoFPS, autoResolution: !$a()(e2.autoResolution) && e2.autoResolution, transactionBgColor: $a()(e2.transactionBgColor) ? 0 : e2.transactionBgColor, maxResolutionLevel: this.getMaxResolution(e2.maxResolutionLevel), forceCanvas: !$a()(e2.forceCanvas) && e2.forceCanvas, enableNvidiaDetect: !$a()(e2.enableNvidiaDetect) && e2.enableNvidiaDetect, transitionResolutionLevel: this.getMaxResolution(e2.transitionResolutionLevel) }, this.updateMaxResolutionLevel(this.config.maxResolutionLevel), this.updateTransitionResolutionLevel(this.config.transitionResolutionLevel), this.loader = new Nm(this.localStorage, t2.useLocalCache, this.logger, this.tracker, t2.resourceTimeout, t2.loadDelegate, t2.urlInterrupter);
34042
+ }, this.logger = t2.logger, this.tracker = t2.tracker, this.mode = t2.mode, this.volumeAdjuster = t2.volumeAdjuster, this.localStorage = new Gy(this.logger), this.cachedExtract = new jy(this.localStorage), this.enableWebAudio = !!$a()(t2.enableWebAudio) || t2.enableWebAudio, this.enableAutoForward = !$a()(t2.enableAutoForward) && t2.enableAutoForward, this.config = { minFPS: $a()(e2.minFPS) ? 30 : e2.minFPS, maxFPS: $a()(e2.maxFPS) ? 40 : e2.maxFPS, resolution: $a()(e2.resolution) ? 1 : e2.resolution, autoFPS: !$a()(e2.autoFPS) && e2.autoFPS, autoResolution: !$a()(e2.autoResolution) && e2.autoResolution, transactionBgColor: $a()(e2.transactionBgColor) ? 0 : e2.transactionBgColor, maxResolutionLevel: this.getMaxResolution(e2.maxResolutionLevel), forceCanvas: !$a()(e2.forceCanvas) && e2.forceCanvas, enableNvidiaDetect: !$a()(e2.enableNvidiaDetect) && e2.enableNvidiaDetect, transitionResolutionLevel: this.getMaxResolution(e2.transitionResolutionLevel), antialias: !!$a()(e2.antialias) || e2.antialias }, this.updateMaxResolutionLevel(this.config.maxResolutionLevel), this.updateTransitionResolutionLevel(this.config.transitionResolutionLevel), this.loader = new Nm(this.localStorage, t2.useLocalCache, this.logger, this.tracker, t2.resourceTimeout, t2.loadDelegate, t2.urlInterrupter);
34030
34043
  const i2 = Ph.isWebGLSupported();
34031
- this.app = new Wh({ antialias: true, autoDensity: false, backgroundColor: 16777215, forceCanvas: this.config.forceCanvas || !i2 }), globalThis.__PIXI_APP__ = this.app, this.tracker({ name: "slidePlayerCreate", result: "", reason: "", payload: { webgl: i2, resolution: this.config.resolution, minFPS: this.config.minFPS, maxFPS: this.config.maxFPS, maxResolutionLevel: this.config.maxResolutionLevel, forceCanvas: this.config.forceCanvas } }), this.updateConfig(this.config), this.app.ticker.maxFPS = 60, this.app.ticker.minFPS = this.config.minFPS, this.app.ticker.maxFPS = this.config.maxFPS, this.app.view.style.zIndex = "1", this.app.stage.sortableChildren = true;
34044
+ this.app = new Wh({ antialias: this.config.antialias, autoDensity: false, backgroundColor: 16777215, forceCanvas: this.config.forceCanvas || !i2 }), globalThis.__PIXI_APP__ = this.app, this.tracker({ name: "slidePlayerCreate", result: "", reason: "", payload: { webgl: i2, resolution: this.config.resolution, minFPS: this.config.minFPS, maxFPS: this.config.maxFPS, maxResolutionLevel: this.config.maxResolutionLevel, forceCanvas: this.config.forceCanvas } }), this.updateConfig(this.config), this.app.ticker.maxFPS = 60, this.app.ticker.minFPS = this.config.minFPS, this.app.ticker.maxFPS = this.config.maxFPS, this.app.view.style.zIndex = "1", this.app.stage.sortableChildren = true;
34032
34045
  const n2 = this.app.renderer;
34033
34046
  if (n2.gl) {
34034
34047
  const { drawElements: t3 } = n2.gl, e3 = n2.gl.getExtension("WEBGL_debug_renderer_info"), i3 = n2.gl.getParameter(e3.UNMASKED_RENDERER_WEBGL);
@@ -36484,7 +36497,7 @@ void main(void){
36484
36497
  }
36485
36498
  var _T = { 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", useraddLink: "useraddLink" }, yT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, xT = "";
36486
36499
  try {
36487
- xT = "1.4.37";
36500
+ xT = "1.4.39";
36488
36501
  } catch (t2) {
36489
36502
  xT = "-dev-";
36490
36503
  }
@@ -39784,7 +39797,7 @@ class SlidePreviewer {
39784
39797
  }
39785
39798
  }
39786
39799
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39787
- const version = "0.2.81";
39800
+ const version = "0.2.82";
39788
39801
  const SlideApp = {
39789
39802
  kind: "Slide",
39790
39803
  setup(context) {