@netless/app-slide 0.2.31 → 0.2.32-beta.2
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.cjs.js +85 -85
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +50 -33
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +159 -159
- package/dist/main.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/main.es.js
CHANGED
|
@@ -28773,7 +28773,7 @@ void main() {
|
|
|
28773
28773
|
function Um(t2, e2, i2) {
|
|
28774
28774
|
return i2 ? Math.floor(parseFloat(t2) * e2) : Math.ceil(parseFloat(t2) * e2);
|
|
28775
28775
|
}
|
|
28776
|
-
const km = { w:
|
|
28776
|
+
const km = { w: false, h: false, x: true, y: true };
|
|
28777
28777
|
class Gm {
|
|
28778
28778
|
constructor(t2) {
|
|
28779
28779
|
this.gifs = /* @__PURE__ */ Object.create(null), this.textures = /* @__PURE__ */ Object.create(null), this.frames = /* @__PURE__ */ Object.create(null), this.spriteSheets = [], this.loader = t2;
|
|
@@ -31430,27 +31430,29 @@ void main(void){
|
|
|
31430
31430
|
};
|
|
31431
31431
|
class c_ extends Za.a {
|
|
31432
31432
|
constructor(t2) {
|
|
31433
|
-
var e2, i2, n2, r2;
|
|
31434
|
-
super(), this.type = "video", this.sprite = new ep(), this.isPlaying = false, this.isGlobalPause = false, this.fullscreen = false, this.url = "", this.
|
|
31433
|
+
var e2, i2, n2, r2, o2;
|
|
31434
|
+
super(), this.type = "video", this.sprite = new ep(), this.isPlaying = false, this.isGlobalPause = false, this.fullscreen = false, this.url = "", this.isLoaded = false, this.onVideoResourceLoaded = () => {
|
|
31435
|
+
this.isLoaded = true;
|
|
31436
|
+
}, this.onVideoStalled = () => {
|
|
31435
31437
|
this.ctx.logger.warn(this.url + ", Failed to fetch data, but trying.", this.ctx.taskId);
|
|
31436
31438
|
}, this.updateVolume = (t3) => {
|
|
31437
|
-
|
|
31439
|
+
this.rtcAudio.volume(t3);
|
|
31438
31440
|
}, this.syncFullscreenVideoState = (t3) => {
|
|
31439
31441
|
const { targetId: e3, state: i3, slideIndex: n3 } = t3;
|
|
31440
31442
|
n3 === this.ctx.slideIndex && e3 === this.id && (i3 ? (this.requestFullscreen(), this.ctx.latestChangeFullscreenTargetId = e3) : this.requestCancelFullscreen());
|
|
31441
31443
|
}, 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;
|
|
31442
|
-
let
|
|
31443
|
-
this.ctx.loaderDelegate && (
|
|
31444
|
-
let
|
|
31445
|
-
this.ctx.loaderDelegate && (
|
|
31446
|
-
const { video:
|
|
31447
|
-
this.controller = new a_({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, width:
|
|
31448
|
-
this.sprite.width =
|
|
31444
|
+
let s2 = t2.video.src;
|
|
31445
|
+
this.ctx.loaderDelegate && (s2 = this.ctx.loaderDelegate.redirectMedia(s2), this.ctx.logger.info(`redirect media url from ${t2.video.src} to ${s2} by delegate.`, t2.ctx.taskId)), this.videoResource = new Vh.w(s2, { autoLoad: true, autoPlay: false, updateFPS: 30, crossorigin: true }), (r2 = this.videoElement) === null || r2 === void 0 || r2.addEventListener("stalled", this.onVideoStalled), (o2 = this.videoElement) === null || o2 === void 0 || o2.addEventListener("loadedmetadata", this.onVideoResourceLoaded), this.url = t2.video.src;
|
|
31446
|
+
let a2 = t2.video.src.replace(/4$/, "3");
|
|
31447
|
+
this.ctx.loaderDelegate && (a2 = this.ctx.loaderDelegate.redirectMedia(a2), this.ctx.logger.info(`redirect media url from ${t2.video.src.replace(/4$/, "3")} to ${a2} by delegate.`, t2.ctx.taskId)), this.rtcAudio = new h_(a2, t2.ctx.runningAudio);
|
|
31448
|
+
const { video: l2, width: h2, height: u2, target: c2 } = t2;
|
|
31449
|
+
this.controller = new a_({ targetId: t2.id, shapeId: t2.shapeId, ctx: t2.ctx, width: h2, height: u2, target: c2, media: this, info: l2, canvasElement: t2.canvasElement }), this.controller.addPlayCallBack(() => {
|
|
31450
|
+
this.sprite.width = h2, this.sprite.height = u2, this.ctx.clock.setTimeout(() => {
|
|
31449
31451
|
this.sprite.visible = true;
|
|
31450
31452
|
}, 50);
|
|
31451
31453
|
});
|
|
31452
|
-
const
|
|
31453
|
-
|
|
31454
|
+
const d2 = new Vh.c(null, { height: u2, width: h2 });
|
|
31455
|
+
d2.resource = this.videoResource, this.videoResource.bind(d2), this.sprite = new ep(), this.sprite.visible = false, this.sprite.texture = new Vh.t(d2), this.sprite.interactive = true, this.container.addChild(this.sprite), this.sprite.on("mouseover", (t3) => {
|
|
31454
31456
|
t3.stopPropagation(), this.controller.show();
|
|
31455
31457
|
}), this.sprite.on("mouseout", (t3) => {
|
|
31456
31458
|
t3.stopPropagation(), this.controller.hide();
|
|
@@ -31469,7 +31471,7 @@ void main(void){
|
|
|
31469
31471
|
return (e2 = (t2 = this.videoElement) === null || t2 === void 0 ? void 0 : t2.currentTime) !== null && e2 !== void 0 ? e2 : 0;
|
|
31470
31472
|
}
|
|
31471
31473
|
set currentTime(t2) {
|
|
31472
|
-
|
|
31474
|
+
this.rtcAudio.currentTime = t2, this.videoElement && (this.videoElement.currentTime = t2);
|
|
31473
31475
|
}
|
|
31474
31476
|
get paused() {
|
|
31475
31477
|
var t2, e2;
|
|
@@ -31493,28 +31495,26 @@ void main(void){
|
|
|
31493
31495
|
this.controller.hide();
|
|
31494
31496
|
}
|
|
31495
31497
|
play() {
|
|
31496
|
-
var t2;
|
|
31497
31498
|
return u_(this, void 0, void 0, function* () {
|
|
31498
31499
|
this.isPlaying = true, this.updateVolume(this.ctx.volumeAdjuster.volume), yield this.load(), yield this.ctx.clock.waitUntil(() => {
|
|
31499
31500
|
const t3 = this.videoElement;
|
|
31500
31501
|
return !!(t3 && t3.videoWidth > 0);
|
|
31501
31502
|
}, 3e3);
|
|
31502
|
-
const
|
|
31503
|
-
|
|
31503
|
+
const t2 = this.videoElement;
|
|
31504
|
+
t2 && t2.videoWidth <= 0 || (this.videoElement && (this.videoElement.volume = 0, this.videoElement.muted = true), this.rtcAudio.once("play", () => {
|
|
31504
31505
|
var t3;
|
|
31505
31506
|
(t3 = this.videoElement) === null || t3 === void 0 || t3.play(), this.fullscreen && this.controller.fullscreenPlay();
|
|
31506
|
-
}), this.rtcAudio.play())
|
|
31507
|
+
}), this.rtcAudio.play());
|
|
31507
31508
|
});
|
|
31508
31509
|
}
|
|
31509
31510
|
load() {
|
|
31510
31511
|
return this.videoResource.load();
|
|
31511
31512
|
}
|
|
31512
31513
|
pause() {
|
|
31513
|
-
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
}), this.rtcAudio.pause()) : (t2 = this.videoElement) === null || t2 === void 0 || t2.pause();
|
|
31514
|
+
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.once("pause", () => {
|
|
31515
|
+
var t2;
|
|
31516
|
+
(t2 = this.videoElement) === null || t2 === void 0 || t2.pause();
|
|
31517
|
+
}), this.rtcAudio.pause();
|
|
31518
31518
|
}
|
|
31519
31519
|
globalPause() {
|
|
31520
31520
|
this.isPlaying && (this.isGlobalPause = true, this.pause());
|
|
@@ -31532,15 +31532,18 @@ void main(void){
|
|
|
31532
31532
|
this.seek(0), this.pause(), this.ctx.eventHub.emit(Gy.mediaStop);
|
|
31533
31533
|
}
|
|
31534
31534
|
requestFullscreen() {
|
|
31535
|
-
|
|
31536
|
-
|
|
31535
|
+
return u_(this, void 0, void 0, function* () {
|
|
31536
|
+
yield Pm(() => this.isLoaded, 5e3);
|
|
31537
|
+
const t2 = new Vh.t(this.sprite.texture.baseTexture);
|
|
31538
|
+
this.ctx.globalEventHub.emit("requestFullscreen", { texture: t2, index: this.ctx.slideIndex, targetId: this.id });
|
|
31539
|
+
});
|
|
31537
31540
|
}
|
|
31538
31541
|
requestCancelFullscreen() {
|
|
31539
31542
|
this.ctx.globalEventHub.emit("requestCancelFullscreen", { targetId: this.id, index: this.ctx.slideIndex });
|
|
31540
31543
|
}
|
|
31541
31544
|
destroy() {
|
|
31542
|
-
var t2;
|
|
31543
|
-
this.ctx.volumeAdjuster.removeListener("update", this.updateVolume), this.ctx.globalEventHub.removeListener("syncFullscreenVideoState", this.syncFullscreenVideoState), this.sprite.interactive = false, this.sprite.destroy({ texture: true, baseTexture: true }), (
|
|
31545
|
+
var t2, e2, i2;
|
|
31546
|
+
this.ctx.volumeAdjuster.removeListener("update", this.updateVolume), this.ctx.globalEventHub.removeListener("syncFullscreenVideoState", this.syncFullscreenVideoState), (t2 = this.videoElement) === null || t2 === void 0 || t2.removeEventListener("stalled", this.onVideoStalled), (e2 = this.videoElement) === null || e2 === void 0 || e2.removeEventListener("loadedmetadata", this.onVideoResourceLoaded), this.sprite.interactive = false, this.sprite.destroy({ texture: true, baseTexture: true }), (i2 = this.videoResource) === null || i2 === void 0 || i2.destroy(), this.rtcAudio.destroy(), this.stop(), this.controller.destroy(), this.ctx.activeMedia.delete(this);
|
|
31544
31547
|
}
|
|
31545
31548
|
}
|
|
31546
31549
|
var d_ = function(t2, e2, i2, n2) {
|
|
@@ -35685,9 +35688,9 @@ void main(void){
|
|
|
35685
35688
|
}
|
|
35686
35689
|
var lT = { 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" }, hT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, uT = "";
|
|
35687
35690
|
try {
|
|
35688
|
-
uT = "0.
|
|
35691
|
+
uT = "0.11.0-beta.1";
|
|
35689
35692
|
} catch (t2) {
|
|
35690
|
-
uT = "dev";
|
|
35693
|
+
uT = "dev-";
|
|
35691
35694
|
}
|
|
35692
35695
|
var cT = null;
|
|
35693
35696
|
try {
|
|
@@ -35703,7 +35706,9 @@ void main(void){
|
|
|
35703
35706
|
return n3.frameResizeHandler();
|
|
35704
35707
|
}), n3.timestamp = function() {
|
|
35705
35708
|
return Date.now();
|
|
35706
|
-
}, n3.mode = "local", n3.enableGlobalClick = false, n3.lastEmitedState = null, n3.playerController = null, n3.isInitResized = false, n3.cacheImage = document.createElement("img"), n3.isTouchStart = false, n3.touchStartId = void 0, n3.taskId = "", n3.volumeAdjuster = new By(), n3.designWidth = 0, n3.designHeight = 0, n3._slideCount = 0, n3._dispatchIncrId = 0, n3._receiveIncrId = 0, n3.
|
|
35709
|
+
}, n3.mode = "local", n3.enableGlobalClick = false, n3.lastEmitedState = null, n3.playerController = null, n3.isInitResized = false, n3.cacheImage = document.createElement("img"), n3.isTouchStart = false, n3.touchStartId = void 0, n3.taskId = "", n3.volumeAdjuster = new By(), n3.designWidth = 0, n3.designHeight = 0, n3._slideCount = 0, n3._dispatchIncrId = 0, n3._receiveIncrId = 0, n3._updateVolumeByStaticAdjuster = function(t3) {
|
|
35710
|
+
n3.volumeAdjuster.volume = t3;
|
|
35711
|
+
}, n3.recoverHandler = function(t3) {
|
|
35707
35712
|
if (t3.data.type === "@slide/_recover_" && t3.data.slideId === n3.randomId) {
|
|
35708
35713
|
var e3 = t3.data, i4 = e3.recoverBy, r2 = e3.payload;
|
|
35709
35714
|
if (!r2)
|
|
@@ -35798,7 +35803,7 @@ void main(void){
|
|
|
35798
35803
|
}), window.addEventListener("__slide_ref__", n3.handleSlideRef), n3.resizeView = Yy()(n3.resizeView.bind(n3), 50), n3.player = n3.initPlayer(n3.config), n3.config.controller && n3.createController(), n3.player.view && n3.canvasContainer.appendChild(n3.player.view), n3.handleViewClick = Yy()(n3.handleViewClick, 300), n3.player.errorChannel.on("error", function(t3, e3) {
|
|
35799
35804
|
var i4 = Tm.transform(t3);
|
|
35800
35805
|
i4.errorType === gm.RuntimeWarn ? n3.logger.warn(i4.message, n3.taskId) : n3.logger.error(i4.message, n3.taskId), n3.isLoading = false, e3 === n3.renderingIndex && n3.reportError(t3, e3);
|
|
35801
|
-
}), window.addEventListener("message", n3.recoverHandler), n3;
|
|
35806
|
+
}), window.addEventListener("message", n3.recoverHandler), e2.volumeAdjuster.on("update", n3._updateVolumeByStaticAdjuster), n3;
|
|
35802
35807
|
}
|
|
35803
35808
|
var i2, n2;
|
|
35804
35809
|
return tT(e2, t2), e2.flushLog = function(t3) {
|
|
@@ -36228,6 +36233,7 @@ void main(void){
|
|
|
36228
36233
|
((r2 = this.player) === null || r2 === void 0 ? void 0 : r2.view) && this.anchor.removeChild(this.player.view), this.anchor.removeChild(this.frame);
|
|
36229
36234
|
} catch (t4) {
|
|
36230
36235
|
}
|
|
36236
|
+
e2.volumeAdjuster.off("update", this._updateVolumeByStaticAdjuster);
|
|
36231
36237
|
}, e2.prototype.waitLoadEnd = function() {
|
|
36232
36238
|
return nT(this, void 0, void 0, function() {
|
|
36233
36239
|
var t3;
|
|
@@ -36294,7 +36300,7 @@ void main(void){
|
|
|
36294
36300
|
var e3 = jy.get(t4.hookPoint) || [];
|
|
36295
36301
|
e3.push(t4), jy.set(t4.hookPoint, e3);
|
|
36296
36302
|
}(t3);
|
|
36297
|
-
}, e2.handleFrozenAllSlide = function() {
|
|
36303
|
+
}, e2.volumeAdjuster = new By(), e2.handleFrozenAllSlide = function() {
|
|
36298
36304
|
e2.instances.forEach(function(t3) {
|
|
36299
36305
|
t3.player && (e2._tempFrozenIds.push(t3.randomId), t3.frozen());
|
|
36300
36306
|
});
|
|
@@ -36410,6 +36416,17 @@ void main(void){
|
|
|
36410
36416
|
t2.data.type === "@slide/_request_frozen_" && dT.handleFrozenAllSlide();
|
|
36411
36417
|
}), window.addEventListener("message", function(t2) {
|
|
36412
36418
|
t2.data.type === "@slide/_request_release_" && dT.handleReleaseAllSlide();
|
|
36419
|
+
}), window.addEventListener("message", function(t2) {
|
|
36420
|
+
if (t2.data.type === "@slide/_update_volume_") {
|
|
36421
|
+
var e2 = 0.5;
|
|
36422
|
+
try {
|
|
36423
|
+
e2 = parseFloat(t2.data.volume.toString());
|
|
36424
|
+
} catch (t3) {
|
|
36425
|
+
}
|
|
36426
|
+
dT.volumeAdjuster.volume = e2;
|
|
36427
|
+
}
|
|
36428
|
+
}), window.addEventListener("message", function(t2) {
|
|
36429
|
+
t2.data.type === "@slide/_get_volume_" && window.postMessage({ type: "@slide/_report_volume_", volume: dT.volumeAdjuster.volume, customMessage: "@slide/_report_volume_" }, "*");
|
|
36413
36430
|
}), window.setInterval(function() {
|
|
36414
36431
|
dT.flushLog().catch(function() {
|
|
36415
36432
|
});
|
|
@@ -38755,7 +38772,7 @@ class SlidePreviewer {
|
|
|
38755
38772
|
}
|
|
38756
38773
|
}
|
|
38757
38774
|
const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
|
|
38758
|
-
const version = "0.2.
|
|
38775
|
+
const version = "0.2.32-beta.2";
|
|
38759
38776
|
const SlideApp = {
|
|
38760
38777
|
kind: "Slide",
|
|
38761
38778
|
setup(context) {
|