@netless/slide 1.1.2 → 1.1.3

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