@netless/app-slide 0.2.42 → 0.2.44

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/index.d.ts CHANGED
@@ -24,82 +24,83 @@ declare function preloadResource(taskId: string, prefix: string, onProgress: (p:
24
24
  declare type UrlInterrupter = (url: string) => Promise<string>;
25
25
  interface ILoaderDelegate {
26
26
  /**
27
- * 加载 json 资源, 需返回 json 文本
28
- * @param url 原始资源地址
27
+ * Load JSON resources, need to return JSON text.
28
+ * @param url Original resource address
29
29
  */
30
30
  loadJson(url: string): Promise<string>;
31
31
  /**
32
- * 加载图片资源, 需返回 Blob 对象
33
- * @param url 原始资源地址
32
+ * Load image resources, return Blob object.
33
+ * @param url Original resource address
34
34
  */
35
35
  loadImage(url: string): Promise<Blob>;
36
36
  /**
37
- * 媒体文件重定向, mp3 mp4 资源会调用这个代理函数, 需返回重定向后的 url
38
- * @param url 原始资源地址
37
+ * Media file redirection, mp3 and mp4 resources will call this proxy function, and the redirected URL should be returned.
38
+ * @param url Original resource address
39
39
  */
40
40
  redirectMedia(url: string): string;
41
41
  }
42
42
  interface RtcAudio {
43
43
  /**
44
- * 开始播放音频.
44
+ * Start playing audio.
45
45
  */
46
46
  play(): void;
47
47
  /**
48
- * 暂停音频播放, 且音频当前播放时间不变
48
+ * Pause audio playback, and the current playback time of the audio remains unchanged.
49
49
  */
50
50
  pause(): void;
51
51
  /**
52
- * 当音频对象不再使用时候被调用
52
+ * When the audio object is no longer in use, it is called.
53
53
  */
54
54
  destroy(): void;
55
55
  /**
56
- * 设置音量, 参数值范围 0 ~ 1
56
+ * Set volume, parameter value range 0 ~ 1.
57
57
  */
58
58
  volume(value: number): void;
59
59
  /**
60
- * 获取音频当前播放时间, 单位为:秒
60
+ * Get the current playing time of the audio, in seconds.
61
61
  */
62
62
  get currentTime(): number;
63
63
  /**
64
- * 设置音频当前播放时间, 单位为:秒。需注意, 无论音频是否正在播放, 都需要确保能设置成功。
65
- * 如果音频暂停状态下, 设置此值, 那么需保证, 下次恢复播放是从此值位置开始播放。
64
+ * Set the current playback time of the audio, in seconds. Please note that whether the audio is playing or not, it needs to be ensured that the setting is successful.
65
+ * If the audio is in a paused state, set this value to ensure that the next time playback resumes, it starts playing from this position.
66
66
  */
67
67
  set currentTime(time: number);
68
68
  /**
69
- * 返回音频是否暂停状态
69
+ * Return whether the audio is in a paused state.
70
70
  */
71
71
  get isPaused(): boolean;
72
72
  /**
73
- * 返回音频时长
73
+ * Return audio duration.
74
74
  */
75
75
  get duration(): number;
76
76
  /**
77
- * 当音频加载完成时触发, 例如: 音频 meta 数据加载完成, 这时候知道了音频实际时长, 就需要触发此事件, 需要保证此事件触发时,
78
- * 能通过 duration 属性获取到更新后的音频时长
77
+ * When the audio is loaded, for example: when the audio meta data is loaded and the actual duration of the audio is known,
78
+ * this event needs to be triggered. It is necessary to ensure that this event is triggered when
79
+ * You can obtain the updated audio duration through the duration attribute.
79
80
  * @param event
80
81
  * @param listener
81
82
  */
82
83
  on(event: "load", listener: () => void): this;
83
84
  /**
84
- * 当音频暂停时候触发
85
+ * Trigger when the audio is paused.
85
86
  * @param event
86
87
  * @param listener
87
88
  */
88
89
  on(event: "pause", listener: () => void): this;
89
90
  /**
90
- * 当音频开始播放时候触发
91
+ * Trigger when the audio is beginning.
91
92
  * @param event
92
93
  * @param listener
93
94
  */
94
95
  on(event: "play", listener: () => void): this;
95
96
  /**
96
- * 移除参数指定事件的所有监听器
97
+ * Remove all listeners for the specified event.
97
98
  */
98
99
  removeAllListeners(event: string): void;
99
100
  }
100
101
  interface RtcAudioClazz {
101
102
  /**
102
- * 创建 rtc 播放器, url 为音频地址
103
+ * Create an RTC player, with the URL as the audio address.
103
104
  * @param url
104
105
  */
105
106
  new (url: string): RtcAudio;
@@ -110,152 +111,161 @@ interface ILogger$1 {
110
111
  warn?(msg: string): void;
111
112
  }
112
113
  declare const SLIDE_EVENTS: {
113
- /** 同步事件派发 */
114
+ /** Synchronous event dispatch. */
114
115
  readonly syncDispatch: "syncDispatch";
115
- /** 同步事件接收 */
116
+ /** Synchronous event reception */
116
117
  readonly syncReceive: "syncReceive";
117
118
  /**
118
- * 同步模式下才会触发这个事件, 指示同步消息滞后, 需要全量同步
119
+ * This event is only triggered in synchronous mode, indicating that synchronous messages are delayed and require full synchronization.
119
120
  */
120
121
  readonly syncEventLag: "syncEventLag";
121
- /** 当前 slide 渲染开始触发 */
122
+ /** The current slide rendering starts triggering. */
122
123
  readonly renderStart: "renderStart";
123
- /** 当前 slide 渲染完毕触发 */
124
+ /** The current slide rendering is complete. */
124
125
  readonly renderEnd: "renderEnd";
125
- /** 当前 slide 渲染出错触发 */
126
+ /** Current slide rendering error triggered. */
126
127
  readonly renderError: "renderError";
127
- /** slide 页码变化时触发 */
128
+ /** Page number change triggers */
128
129
  readonly slideChange: "slideChange";
129
- /** 主序列动画开始时触发 */
130
+ /** Trigger at the beginning of the main sequence animation. */
130
131
  readonly mainSeqStepStart: "mainSeqStepStart";
131
- /** 主序列动画结束时触发 */
132
+ /** Triggered at the end of the main sequence animation. */
132
133
  readonly mainSeqStepEnd: "mainSeqStepEnd";
133
134
  /**
134
- * 任意动画开始时触发
135
+ * Trigger at the start of any animation.
135
136
  */
136
137
  readonly animateStart: "animateStart";
137
138
  /**
138
- * 任意动画结束时触发
139
+ * Trigger at the end of any animation.
139
140
  */
140
141
  readonly animateEnd: "animateEnd";
141
- /** slide 状态变化触发 */
142
+ /** slide State change trigger */
142
143
  readonly stateChange: "stateChange";
143
- /** ppt 已经没有下一步动作触发 **/
144
+ /** ppt There is no next action trigger. **/
144
145
  readonly slideStepEnd: "slideEnd";
145
- /** ppt 已经没有上一步动作触发 **/
146
+ /** ppt There is no previous action triggered. **/
146
147
  readonly slideStepStart: "slideStart";
147
148
  };
148
149
  interface ISlideRenderOptions {
149
- /** 预期最低渲染 fps, 默认 40 */
150
+ /** Minimum expected rendering fps, default is 40 */
150
151
  minFPS?: number;
151
- /** 预期最高渲染 fps, 默认 50 */
152
+ /** Expected maximum rendering fps, default is 50 */
152
153
  maxFPS?: number;
153
- /** 渲染分辨倍率, 整数, 默认为 window.devicePixelRatio */
154
+ /** 渲染分辨倍率, 整数, default is window.devicePixelRatio */
154
155
  resolution?: number;
155
- /** 是否根据 fps, 自动调整分辨率, 默认为 false */
156
+ /** Whether to automatically adjust the resolution based on fps., default is false */
156
157
  autoResolution?: boolean;
157
- /** 是否自动降低渲染 fps */
158
+ /** Automatically reduce rendering. fps */
158
159
  autoFPS?: boolean;
159
- /** 播放切页动画时候的背景颜色, 接受 css 颜色字符串或者 16进制颜色值("#ffffff",0xffffff) */
160
+ /** Background color when playing page transition animation, accepts CSS color strings or hexadecimal color values ("#ffffff", 0xffffff) */
160
161
  transactionBgColor?: string | number;
161
162
  /**
162
- * 用于设置最高显示分辨率。此值不仅影响 canvas 渲染分辨率, 同时也影响纹理质量,
163
- * 在低端设备, 降低此值能极大改善内存占用及图片黑屏现象.
164
- * [1] 最低 960 * 540, 小于 1 1 计算;
165
- * [2] 普通 1280 * 720; --- 移动端默认设置.
166
- * [3] 高清 1920 * 1080;
167
- * [4] 3K 3200 × 1800, 大于 4 4 计算; --- pc 端默认设置.
168
- * 默认情况下, pc 设备 3K, 移动设备 720P
163
+ * Used to set the maximum display resolution. This value not only affects the canvas rendering resolution, but also affects the texture quality.
164
+ * On low-end devices, reducing this value can greatly improve memory usage and image black screen phenomenon.
165
+ * [1] Minimum 960 * 540, less than 1 is calculated as 1;
166
+ * [2] Normal 1280 * 720; --- default setting for mobile devices.
167
+ * [3] HD 1920 * 1080;
168
+ * [4] 3K 3200 × 1800, greater than 4 is calculated as 4; --- default setting for PC devices.
169
+ * By default, PC devices are set to 3K, and mobile devices are set to 720P.
169
170
  */
170
171
  maxResolutionLevel?: number;
171
172
  /**
172
- * 是否强制使用 2d 渲染, 强制使用 2d 渲染会丢失部分 3d、滤镜、特效
173
+ * Whether to force the use of 2D rendering, forcing the use of 2D rendering will lose some 3D, filters, and effects.
173
174
  */
174
175
  forceCanvas?: boolean;
175
176
  /**
176
- * @deprecated 当前版本已经修复花屏问题, 无需开启这个参数
177
- * 是否开启 NVIDIA 显卡检测, windows 11 配合 NVIDIA 显卡在
178
- * 播放部分切页动画时会花屏。
179
- * 开启这个选项, 会自动检测是否 NVIDIA, 如果是 NVIDIA 显卡则
180
- * 使用不同的逻辑播放切页动画, 不会花屏, 但是切页响应会慢 200 ~ 1000 ms
177
+ * @deprecated The current version has fixed the screen flickering issue, so there is no need to enable this parameter.
178
+ * Should NVIDIA graphics card detection be enabled, Windows 11 with NVIDIA graphics card may experience screen flickering when playing certain page transition animations.
179
+ * Enabling this option will automatically detect whether it is an NVIDIA graphics card. If it is,
180
+ * it will use different logic to play page transition animations without screen flickering, but the response time for page transitions will be slower by 200 to 1000 ms.
181
181
  */
182
182
  enableNvidiaDetect?: boolean;
183
183
  }
184
184
  interface INavigatorDelegate {
185
- gotoPage(index: number): void;
185
+ gotoPage?: (index: number) => void;
186
+ openUrl?: (url: string) => void;
186
187
  }
187
188
  interface ISlideConfig {
188
- /** canvas 挂载点 */
189
+ /** canvas mount dom */
189
190
  anchor: HTMLDivElement;
190
- /** 是否可互动 */
191
+ /** can it interact */
191
192
  interactive: boolean;
192
- /** 渲染选项, 可选 */
193
+ /** render options, Optional */
193
194
  renderOptions?: ISlideRenderOptions;
194
- /** 是否展示控制栏和stats */
195
+ /** Whether to display the control bar and stats */
195
196
  controller?: boolean;
196
- /** 是否根据窗口大小自动调整分辨率 */
197
+ /** Whether to automatically adjust the resolution according to the window size */
197
198
  resize?: boolean;
198
- /** 获取房间时间 */
199
+ /** Get room time */
199
200
  timestamp?: () => number;
200
201
  /**
201
- * 运行模式
202
+ * Operating mode
202
203
  *
203
- * "interactive" 互动模式, 所有人都可以操作 ppt
204
- * "sync" 同步模式, 只有一个人能操作 ppt
205
- * "local" 本地模式, 不会触发任意同步事件
204
+ * "interactive" Interactive mode, everyone can operate ppt
205
+ * "sync" Synchronization mode, only one person can operate ppt
206
+ * "local" Local mode, no synchronization events will be triggered
206
207
  */
207
208
  mode: "interactive" | "sync" | "local";
208
209
  /**
209
- * 是否启用全局点击, 开启后, 只要点击到 ppt 视口范围,
210
- * 并且没有触发 ppt 内部可互动元素, 就会触发下一步动作.
211
- * 默认为 false
210
+ * Whether to enable global clicking, after turning on, as long as you click within the ppt viewport range,
211
+ * and do not trigger interactive elements inside ppt, it will trigger the next action.
212
+ * Default is false
212
213
  */
213
214
  enableGlobalClick?: boolean;
214
215
  /**
215
- * 提供的音频播放器类, 用于 rtc 混音
216
+ * The provided audio player class, used for rtc mixing
216
217
  */
217
218
  rtcAudio?: RtcAudioClazz;
218
219
  /**
219
- * 提供 logger 对象, 用以记录运行日志
220
+ * Provide logger object for recording operation logs
220
221
  */
221
222
  logger?: ILogger$1;
222
223
  /**
223
- * 是否启用本地缓存,启用后会将 ppt 远程资源缓存在 indexDB
224
- * 默认为 true
224
+ * Whether to enable local caching, after enabling, ppt remote resources will be cached in indexDB
225
+ * Default is true
225
226
  */
226
227
  useLocalCache?: boolean;
227
228
  /**
228
- * 资源加载超时时间, 默认 15
229
+ * Resource loading timeout, default 15 seconds
229
230
  */
230
231
  resourceTimeout?: number;
231
232
  /**
232
- * 远程资源代理, 详细使用参考 README
233
+ * Remote resource proxy, for detailed use refer to README
233
234
  */
234
235
  loaderDelegate?: ILoaderDelegate;
235
236
  /**
236
- * ppt 页码导航代理, 添加此属性后, ppt 内部动作引起的页码变换, 全部走代理逻辑.
237
+ * PPT page navigation proxy, after adding this property,
238
+ * the page number changes caused by actions within the ppt,
239
+ * all go through the proxy logic.
240
+ * PPT opens the webpage, needs to open through the openUrl method,
241
+ * PPT page turning, needs to turn pages through the gotoPage method.
237
242
  */
238
243
  navigatorDelegate?: INavigatorDelegate;
239
244
  /**
240
- * 设置 ppt 固定高宽, 设置后 ppt 不会跟随父元素的大小自动变化
241
- * 如果有缩放需求,需要调用 updateFixedFrameSize 方法
242
- * width height 属性单位为 px
245
+ * Set a fixed height and width for ppt, after setting, ppt will not change automatically with the size of the parent element
246
+ * If there is a need for scaling, you need to call the updateFixedFrameSize method
247
+ * The units of width and height attributes are px
243
248
  */
244
249
  fixedFrameSize?: {
245
250
  width: number;
246
251
  height: number;
247
252
  };
248
253
  /**
249
- * 客户端 id, 在同步及互动场景下, 需要能区分每个不同的客户端。对于收到同步消息的一端来说, 需要用这个
250
- * clientId 区分是不是自己发出的消息又被自己接收了。
251
- * 如果同步及互动场景下, 没有给这个值会造成某些情况下的状态不同步,已知的场景有:
252
- * 1. ppt 某一页有自动动画, 动画过程中进行的下一步动作, 在其他客户端可能表现为下一页(即翻页)
254
+ * Client id, in synchronization and interactive scenarios, it needs to be able to distinguish each different client.
255
+ * For the end that receives the synchronization message, this needs to be used
256
+ * ClientId distinguishes whether the message sent by oneself is received by oneself.
257
+ * If in the synchronization and interactive scenarios,
258
+ * not giving this value will cause the status to be out of sync in some cases,
259
+ * the known scenarios are:
260
+ * 1. A certain page of ppt has automatic animation, the next action performed during the animation,
261
+ * on other clients may appear as the next page (i.e. page turning)
253
262
  */
254
263
  clientId?: string;
255
264
  urlInterrupter?: UrlInterrupter;
256
265
  /**
257
- * 是否开启日志追踪, 开启后会向 sdk 远程服务器定时定量上传本地日志
258
- * 默认 true
266
+ * Whether to enable log tracking, after enabling,
267
+ * local logs will be regularly and quantitatively uploaded to the sdk remote server
268
+ * default is true
259
269
  */
260
270
  enableTracking?: boolean;
261
271
  }
@@ -452,16 +462,16 @@ declare class Slide extends Slide_base {
452
462
  private setMedianControllerAttribute;
453
463
  private frameResizeHandler;
454
464
  /**
455
- * 更新 ppt 固定高宽, 此方法只有在设置了 fixedFrameSize 配置项的情况下才会生效
456
- * @param width 需要更新的宽度值, 单位 px
457
- * @param height 需要更新的高度值, 单位 px
465
+ * Update ppt fixed height and width, this method only takes effect when the fixedFrameSize configuration item is set.
466
+ * @param width Width value that needs to be updated, unit px.
467
+ * @param height Height value that needs to be updated, unit px.
458
468
  */
459
469
  updateFixedFrameSize(width: number, height: number, callback?: () => void): void;
460
470
  private resizeView;
461
471
  private receiveSyncHandler;
462
472
  /**
463
- * 设置整个 slide 的状态, slide 会以传入的状态更新画面.
464
- * 供整体同步时候调用.
473
+ * Set the state of the entire slide, the slide will update the screen with the incoming state.
474
+ * It is called when synchronizing the whole.
465
475
  * @param state ISlideState
466
476
  */
467
477
  setSlideState(state: Partial<ISlideState>): Promise<void>;
@@ -472,71 +482,72 @@ declare class Slide extends Slide_base {
472
482
  */
473
483
  get slideCount(): number;
474
484
  /**
475
- * 获取 slide 设计高宽, 单位为 px, 返回数组形式为 [width, height]
476
- * 可以在 renderSlide 之前调用
485
+ * Get the width and height of the slide in pixels,
486
+ * return the array in the form [width, height].
487
+ * Can be called before rendering the slide.
477
488
  */
478
489
  getSizeAsync(): Promise<[number, number]>;
479
490
  /**
480
- * 获取 slide 总页数, 可以在 renderSlide 之前调用
491
+ * Get the total number of slides, you can call it before renderSlide.
481
492
  */
482
493
  getSlideCountAsync(): Promise<number>;
483
494
  /**
484
- * 整个 slide 的状态, 将获取的值传递给另一个客户端, 并调用 setSlideState
485
- * 可以完成整体同步. 只读属性.
495
+ * The state of the entire slide, pass the obtained value to another client,
496
+ * and call setSlideState to achieve overall synchronization. Read-only property.
486
497
  * @readonly
487
498
  */
488
499
  get slideState(): ISlideState;
489
500
  /**
490
- * 主序列动画步数, 只读属性
501
+ * Main sequence animation steps, read-only property.
491
502
  * @readonly
492
503
  */
493
504
  get mainSeqLength(): number;
494
505
  /**
495
- * 主序列动画, 当前步, 只读属性
506
+ * Main sequence animation, current step, read-only property.
496
507
  * @readonly
497
508
  */
498
509
  get mainSeqStep(): number;
499
510
  /**
500
- * 主序列动画, 当前状态, 只读属性
501
- * "idle": 动画尚未运行
502
- * "running": 动画运行中
503
- * "end": 动画已经结束
504
- * null: 当前 Slide 没有主序列动画
511
+ * Main sequence animation, current state, read-only property
512
+ * "idle": Animation has not started
513
+ * "running": Animation is in progress
514
+ * "end": Animation has ended
515
+ * null: The current slide does not have a main sequence animation
505
516
  * @readonly
506
517
  */
507
518
  get mainSeqState(): "idle" | "running" | "end" | null;
508
519
  /**
509
- * 实时渲染属性, 只读属性.
520
+ * Real-time rendering properties, read-only properties.
510
521
  * @readonly
511
522
  */
512
523
  get renderOptions(): ISlideRenderOptions | null;
513
524
  /**
514
- * drawCall 次数, 即每帧调用 gpu drawElements 次数, 只读属性.
525
+ * drawCall count, which means the number of times gpu drawElements is called per frame, read-only property.
515
526
  * @readonly
516
527
  */
517
528
  get drawCall(): number;
518
529
  /**
519
- * 渲染 fps, 只读属性.
530
+ * Rendering fps, read-only property.
520
531
  * @readonly
521
532
  */
522
533
  get renderFps(): number;
523
534
  /**
524
- * js 运行时 fps, 只读属性.
535
+ * js runtime fps, read-only.
525
536
  * @readonly
526
537
  */
527
538
  get runtimeFps(): number;
528
539
  /**
529
- * 渲染 Slide canvas 元素.
540
+ * Render the canvas element of the Slide.
530
541
  * @readonly
531
542
  */
532
543
  get view(): HTMLCanvasElement | null;
533
544
  /**
534
- * Slide 宽度. 此宽度为设计宽度, ppt 决定. 只读属性.
545
+ * Slide width. This width is the design width determined by ppt. Read-only property.
535
546
  * @readonly
536
547
  */
537
548
  get width(): number;
538
549
  /**
539
- * Slide 高度. 此高度为设计高度, ppt 决定. 只读属性.
550
+ * Slide height. This height is the design height determined by ppt. Read-only property.
540
551
  * @readonly
541
552
  */
542
553
  get height(): number;
@@ -546,9 +557,9 @@ declare class Slide extends Slide_base {
546
557
  */
547
558
  updateRenderOption(renderOptions: ISlideRenderOptions): void;
548
559
  /**
549
- * 设置 ppt 转换后的资源
550
- * @param taskId 转换任务 id
551
- * @param url 资源 url 前缀
560
+ * Set resources after converting ppt
561
+ * @param taskId task id
562
+ * @param url Resource URL prefix
552
563
  */
553
564
  setResource(taskId: string, url: string): void;
554
565
  private _renderSlide;
@@ -556,17 +567,18 @@ declare class Slide extends Slide_base {
556
567
  private handleNextSlide;
557
568
  private handleGotoSlide;
558
569
  /**
559
- * 渲染 index 参数对应的 ppt 页.
560
- * @param index 要显示的页码, 1 开始
570
+ * Render the ppt page corresponding to the index parameter.
571
+ * @param index Page number to display, starting from 1.
561
572
  */
562
573
  renderSlide(index: number, isForward?: boolean): void;
563
574
  private needCreateNewPlayer;
564
575
  private poseRenderSlide;
565
576
  /**
566
- * 直接渲染 index 指定的页码, 不论当前是 sync 还是 interactive 模式.
567
- * 即调用此方法不会触发 syncDispatch 事件
568
- * @param index 要渲染的页码
569
- * @param isForward 是否向前翻页, 影响切页动画时正放还是倒放
577
+ * Render the page specified by the index directly,
578
+ * regardless of whether the current mode is sync or interactive.
579
+ * Calling this method will not trigger the syncDispatch event.
580
+ * @param index Page number to render
581
+ * @param isForward Whether to flip forward or backward, affecting the page transition animation.
570
582
  */
571
583
  doRenderSlide(index: number, isForward?: boolean): Promise<void>;
572
584
  getSnapshot(): string | null;
@@ -576,7 +588,7 @@ declare class Slide extends Slide_base {
576
588
  nextStep(): void;
577
589
  private doNextStep;
578
590
  /**
579
- * 执行上一个主序列动画
591
+ * Execute the previous main sequence animation.
580
592
  */
581
593
  prevStep(): void;
582
594
  private doPrevStep;
@@ -584,75 +596,76 @@ declare class Slide extends Slide_base {
584
596
  private emitStateChange;
585
597
  private emitSyncDispatch;
586
598
  /**
587
- * 重置主序列动画
588
- * @param index 将要重置到的步数
589
- * @param status 将要重置到的状态, "start" 重置到动画开始, "end" 重置到动画结束
599
+ * Reset main sequence animation.
600
+ * @param index Number of steps to reset to.
601
+ * @param status The state to be reset to, "start" resets to the beginning of the animation, "end" resets to the end of the animation.
590
602
  */
591
603
  setMainSeqStep(index: number, status: "start" | "end"): void;
592
604
  /**
593
- * 设置是否可以互动
605
+ * Set whether interaction is allowed.
594
606
  * @param val boolean
595
607
  */
596
608
  setInteractive(val: boolean): void;
597
609
  /**
598
- * 暂停播放, 非同步操作
610
+ * Pause playback, asynchronous operation.
599
611
  */
600
612
  pause(): void;
601
613
  /**
602
- * 恢复播放状态, 非同步操作
614
+ * Resume playback state, asynchronous operation.
603
615
  */
604
616
  resume(): void;
605
617
  private _doFrozen;
606
618
  /**
607
- * 进入冻结状态, ppt 画面缓存为一张图片, 并释放 webgl 上下文
619
+ * Enter freeze state, cache the ppt screen as an image, and release the WebGL context.
608
620
  */
609
621
  frozen(): void;
610
622
  private _doRelease;
611
623
  /**
612
- * 从冻结状态恢复
624
+ * Recover from frozen state.
613
625
  */
614
626
  release(): void;
615
627
  private _doDestroy;
616
628
  private waitLoadEnd;
617
629
  preload(index: number): Promise<void>;
618
630
  /**
619
- * 销毁方法.
631
+ * Destruction method.
620
632
  */
621
633
  destroy(): void;
622
634
  /**
623
- * 销毁当前 Slide 实例的本地缓存, 需要在 destroy 之前调用。
635
+ * Destroy the local cache of the current Slide instance, need to be called before destroy.
624
636
  */
625
637
  clearSlideCache(): void;
626
638
  /**
627
- * 返回 ppt 是否存在下一步动作
639
+ * Return whether there is a next action in the ppt.
628
640
  */
629
641
  hasNextStep(): boolean;
630
642
  /**
631
- * 返回 ppt 是否存在上一步动作
643
+ * Return whether there is a previous action in the ppt.
632
644
  */
633
645
  hasPrevStep(): boolean;
634
646
  /**
635
- * 截取当前状态的截图
636
- * @return 图片 dataUrl, 如果失败则返回 null
647
+ * Capture a screenshot of the current state.
648
+ * @return 图片 dataUrl, if failed return null
637
649
  */
638
650
  snapshot(): Promise<string | null>;
639
651
  /**
640
- * 截取动画最后一步状态的截图
641
- * @param index 要截取的页码
642
- * @return 图片 dataUrl, 如果失败则返回 null
652
+ * Capture a screenshot of the final step of the animation.
653
+ * @param index The index of the slide to be captured.
654
+ * @return 图片 dataUrl, if failed return null
643
655
  */
644
656
  snapshotWithTimingEnd(index: number): Promise<string | null>;
645
657
  /**
646
- * 设置此 Slide 实例全局音量, 非同步操作, 只会修改本地音量,不会触发同步事件
647
- * @param v 数值范围 0 ~ 1
658
+ * Set the global volume of this Slide instance, asynchronous operation,
659
+ * only modify the local volume, will not trigger synchronous events.
660
+ * @param v Value range 0 ~ 1
648
661
  */
649
662
  updateGlobalVolume(v: number): void;
650
663
  /**
651
- * 获取此 Slide 实例全局音量
664
+ * Get the global volume of this Slide instance.
652
665
  */
653
666
  getGlobalVolume(): number;
654
667
  /**
655
- * 销毁历史所有本地缓存
668
+ * Destroy all local cache of historical records.
656
669
  */
657
670
  static clearLocalCache(): void;
658
671
  /**
@@ -1014,7 +1027,7 @@ interface AppOptions extends Pick<ISlideConfig, "rtcAudio" | "useLocalCache" | "
1014
1027
  autoFPS?: boolean;
1015
1028
  /** whether to re-scale automatically @default true */
1016
1029
  autoResolution?: boolean;
1017
- /** 1~4, default: 3 */
1030
+ /** 0~4, default: 3 */
1018
1031
  maxResolutionLevel?: number;
1019
1032
  /** use canvas2d mode, downside: some 3d effects are lost */
1020
1033
  forceCanvas?: boolean;