@netless/slide 1.4.59 → 1.4.60
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/README.md +23 -0
- package/lib/PlayerContextReleaseWait.js +41 -0
- package/lib/Slide.d.ts +12 -0
- package/lib/Slide.js +14 -14
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
## changelog
|
|
6
6
|
|
|
7
|
+
### 1.4.60 (2026-09-21)
|
|
8
|
+
* 新增 `onPptMediaPermissionRequest(callback)` 与 `playPptMedia()`,支持在浏览器阻止自动播放时通知业务方并由真实用户点击恢复当前媒体
|
|
9
|
+
* 增加 HTML5 音频和视频播放确认,覆盖浏览器静默暂停或未触发 `playerror` 的情况
|
|
10
|
+
* 修复部分移动浏览器播放前 `duration`、`seekable` 为 0 导致 Howler 提前结束且不触发权限回调的问题
|
|
11
|
+
* 修复视频启动时浏览器底层暂停独立音轨,以及用户点击恢复遇到 Howler pending play 无法重新播放的问题
|
|
12
|
+
|
|
13
|
+
### 1.4.60-alpha.0 (2026-09-20)
|
|
14
|
+
* 修复部分移动浏览器中 HTML5 音频播放请求卡住后,用户点击恢复仍无法重新发起播放的问题
|
|
15
|
+
* 避免将媒体加载或缓冲过程误判为自动播放权限错误,并忽略旧播放请求的迟到事件
|
|
16
|
+
|
|
17
|
+
### 1.4.59 (2026-09-18)
|
|
18
|
+
* 优化移动端切页时的 Player 与 WebGL context 生命周期,减少重复创建和资源残留
|
|
19
|
+
* 完善 Player 原地重置、候选 Player 交换和失败回退,避免快速切页后出现白屏或旧画面
|
|
20
|
+
* 加强纹理缓存隔离、取消任务清理和 context 释放超时保护,降低页面切换对 RTC 与其他 WebGL 内容的影响
|
|
21
|
+
|
|
22
|
+
### 1.4.59-alpha.4 (2026-09-17)
|
|
23
|
+
* 增强 PPT 媒体自动播放恢复:为 Howler/HTML5 音频与视频增加播放确认 watchdog,覆盖浏览器静默失败未触发 `playerror` 的场景
|
|
24
|
+
* 修正 Howler `playerror` 在内部状态已变为 playing 但 DOM 仍 paused 时被误过滤的问题
|
|
25
|
+
|
|
26
|
+
### 1.4.59-alpha.0 (2026-09-11)
|
|
27
|
+
* 新增 `onPptMediaPermissionRequest(callback)` 接口,用于通知当前 PPT 音视频需要用户交互后才能播放
|
|
28
|
+
* 新增 `playPptMedia()` 接口,用于在用户点击事件中恢复当前仍处于播放状态、且本地被浏览器拦截的 PPT 音视频
|
|
29
|
+
|
|
7
30
|
### 1.4.58 (2026-09-07)
|
|
8
31
|
* 修复低版本 WebView 中纯色图形显示为黑块的问题
|
|
9
32
|
* 修复切页或销毁 Stage 后无限循环动画回调仍访问已释放 Pixi 对象导致的异常
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wait for the browser to finish releasing a destroyed WebGL context before
|
|
3
|
+
* creating a replacement player. Uses rAF when available, but always settles
|
|
4
|
+
* within a bounded timeout so hidden/background WebViews cannot hang release.
|
|
5
|
+
*/
|
|
6
|
+
export function waitForPlayerContextRelease(platform) {
|
|
7
|
+
var isMobile = platform.isIOS() || platform.isAndroid();
|
|
8
|
+
var minFrames = isMobile ? 4 : 2;
|
|
9
|
+
var settleMs = isMobile ? 100 : 16;
|
|
10
|
+
var maxWaitMs = isMobile ? 500 : 200;
|
|
11
|
+
return new Promise(function (resolve) {
|
|
12
|
+
var settled = false;
|
|
13
|
+
var complete = function () {
|
|
14
|
+
if (settled) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
settled = true;
|
|
18
|
+
setTimeout(resolve, settleMs);
|
|
19
|
+
};
|
|
20
|
+
var timeoutId = setTimeout(complete, maxWaitMs);
|
|
21
|
+
var frameCount = 0;
|
|
22
|
+
var nextFrame = function () {
|
|
23
|
+
if (settled) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
frameCount += 1;
|
|
27
|
+
if (frameCount >= minFrames) {
|
|
28
|
+
clearTimeout(timeoutId);
|
|
29
|
+
complete();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (typeof window.requestAnimationFrame === "function") {
|
|
33
|
+
window.requestAnimationFrame(nextFrame);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
setTimeout(nextFrame, 0);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
nextFrame();
|
|
40
|
+
});
|
|
41
|
+
}
|
package/lib/Slide.d.ts
CHANGED
|
@@ -471,6 +471,10 @@ export declare class Slide extends Slide_base {
|
|
|
471
471
|
private playerGeneration;
|
|
472
472
|
private playerGenerations;
|
|
473
473
|
private playerSwapRenderTimeoutMs;
|
|
474
|
+
private pptMediaPermissionCallbacks;
|
|
475
|
+
private pptMediaPermissionNotified;
|
|
476
|
+
private pptMediaPermissionRenotifyPending;
|
|
477
|
+
private pendingPptMediaState?;
|
|
474
478
|
private renderingIndex;
|
|
475
479
|
private frameWidth;
|
|
476
480
|
private frameHeight;
|
|
@@ -522,6 +526,14 @@ export declare class Slide extends Slide_base {
|
|
|
522
526
|
static handleLogDownload: () => Promise<void>;
|
|
523
527
|
private urlInterrupter;
|
|
524
528
|
private initPlayer;
|
|
529
|
+
private getPptMediaState;
|
|
530
|
+
private getPlayingMediaIds;
|
|
531
|
+
private hasPptMediaPermissionRequest;
|
|
532
|
+
private notifyPptMediaPermissionRequest;
|
|
533
|
+
private handlePptMediaPermissionRequest;
|
|
534
|
+
private handlePptMediaPermissionResolved;
|
|
535
|
+
onPptMediaPermissionRequest(callback: () => void): () => void;
|
|
536
|
+
playPptMedia(): void;
|
|
525
537
|
private userInputHandle;
|
|
526
538
|
private _handleViewClick;
|
|
527
539
|
private handleViewTouchStart;
|