@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 +153 -140
- package/dist/main.cjs.js +92 -92
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +436 -418
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +149 -149
- package/dist/main.iife.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
78
|
-
*
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
122
|
+
/** The current slide rendering starts triggering. */
|
|
122
123
|
readonly renderStart: "renderStart";
|
|
123
|
-
/**
|
|
124
|
+
/** The current slide rendering is complete. */
|
|
124
125
|
readonly renderEnd: "renderEnd";
|
|
125
|
-
/**
|
|
126
|
+
/** Current slide rendering error triggered. */
|
|
126
127
|
readonly renderError: "renderError";
|
|
127
|
-
/**
|
|
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
|
-
/**
|
|
150
|
+
/** Minimum expected rendering fps, default is 40 */
|
|
150
151
|
minFPS?: number;
|
|
151
|
-
/**
|
|
152
|
+
/** Expected maximum rendering fps, default is 50 */
|
|
152
153
|
maxFPS?: number;
|
|
153
|
-
/** 渲染分辨倍率, 整数,
|
|
154
|
+
/** 渲染分辨倍率, 整数, default is window.devicePixelRatio */
|
|
154
155
|
resolution?: number;
|
|
155
|
-
/**
|
|
156
|
+
/** Whether to automatically adjust the resolution based on fps., default is false */
|
|
156
157
|
autoResolution?: boolean;
|
|
157
|
-
/**
|
|
158
|
+
/** Automatically reduce rendering. fps */
|
|
158
159
|
autoFPS?: boolean;
|
|
159
|
-
/**
|
|
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
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* [1]
|
|
165
|
-
* [2]
|
|
166
|
-
* [3]
|
|
167
|
-
* [4] 3K 3200 × 1800,
|
|
168
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
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)
|
|
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
|
-
/**
|
|
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"
|
|
204
|
-
* "sync"
|
|
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
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
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
|
-
*
|
|
216
|
+
* The provided audio player class, used for rtc mixing
|
|
216
217
|
*/
|
|
217
218
|
rtcAudio?: RtcAudioClazz;
|
|
218
219
|
/**
|
|
219
|
-
*
|
|
220
|
+
* Provide logger object for recording operation logs
|
|
220
221
|
*/
|
|
221
222
|
logger?: ILogger$1;
|
|
222
223
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
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
|
-
*
|
|
229
|
+
* Resource loading timeout, default 15 seconds
|
|
229
230
|
*/
|
|
230
231
|
resourceTimeout?: number;
|
|
231
232
|
/**
|
|
232
|
-
*
|
|
233
|
+
* Remote resource proxy, for detailed use refer to README
|
|
233
234
|
*/
|
|
234
235
|
loaderDelegate?: ILoaderDelegate;
|
|
235
236
|
/**
|
|
236
|
-
*
|
|
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
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* width
|
|
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
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
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
|
-
*
|
|
258
|
-
*
|
|
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
|
-
*
|
|
456
|
-
* @param width
|
|
457
|
-
* @param height
|
|
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
|
-
*
|
|
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
|
-
*
|
|
476
|
-
*
|
|
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
|
-
*
|
|
491
|
+
* Get the total number of slides, you can call it before renderSlide.
|
|
481
492
|
*/
|
|
482
493
|
getSlideCountAsync(): Promise<number>;
|
|
483
494
|
/**
|
|
484
|
-
*
|
|
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
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
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
|
|
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
|
-
*
|
|
530
|
+
* Rendering fps, read-only property.
|
|
520
531
|
* @readonly
|
|
521
532
|
*/
|
|
522
533
|
get renderFps(): number;
|
|
523
534
|
/**
|
|
524
|
-
* js
|
|
535
|
+
* js runtime fps, read-only.
|
|
525
536
|
* @readonly
|
|
526
537
|
*/
|
|
527
538
|
get runtimeFps(): number;
|
|
528
539
|
/**
|
|
529
|
-
*
|
|
540
|
+
* Render the canvas element of the Slide.
|
|
530
541
|
* @readonly
|
|
531
542
|
*/
|
|
532
543
|
get view(): HTMLCanvasElement | null;
|
|
533
544
|
/**
|
|
534
|
-
* Slide
|
|
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
|
|
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
|
-
*
|
|
550
|
-
* @param taskId
|
|
551
|
-
* @param 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
|
-
*
|
|
560
|
-
* @param index
|
|
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
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
* @param
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
639
|
+
* Return whether there is a next action in the ppt.
|
|
628
640
|
*/
|
|
629
641
|
hasNextStep(): boolean;
|
|
630
642
|
/**
|
|
631
|
-
*
|
|
643
|
+
* Return whether there is a previous action in the ppt.
|
|
632
644
|
*/
|
|
633
645
|
hasPrevStep(): boolean;
|
|
634
646
|
/**
|
|
635
|
-
*
|
|
636
|
-
* @return 图片 dataUrl,
|
|
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,
|
|
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
|
-
*
|
|
647
|
-
*
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
1030
|
+
/** 0~4, default: 3 */
|
|
1018
1031
|
maxResolutionLevel?: number;
|
|
1019
1032
|
/** use canvas2d mode, downside: some 3d effects are lost */
|
|
1020
1033
|
forceCanvas?: boolean;
|