@netless/slide 0.5.10 → 0.5.14-alpha.0

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.
@@ -6,7 +6,7 @@ export interface FrozenTask {
6
6
  export declare class FrozenTaskManager {
7
7
  private tasks;
8
8
  private isDestroy;
9
- constructor();
9
+ private isScheduling;
10
10
  private schedule;
11
11
  private getRunningTask;
12
12
  addTask(type: "frozen" | "release", fn: () => Promise<void>): void;
@@ -3,21 +3,29 @@ var FrozenTaskManager = /** @class */ (function () {
3
3
  var _this = this;
4
4
  this.tasks = [];
5
5
  this.isDestroy = false;
6
+ this.isScheduling = false;
6
7
  this.schedule = function () {
8
+ _this.isScheduling = true;
7
9
  var task = _this.tasks.shift();
8
10
  if (task && !_this.isDestroy) {
9
11
  task.status = "running";
10
12
  task.fn.apply(null).then(function () {
11
- window.setTimeout(_this.schedule);
13
+ if (_this.tasks.length > 0) {
14
+ window.requestAnimationFrame(_this.schedule);
15
+ }
16
+ else {
17
+ _this.isScheduling = false;
18
+ }
12
19
  }).catch(function () {
13
- window.setTimeout(_this.schedule);
20
+ if (_this.tasks.length > 0) {
21
+ window.requestAnimationFrame(_this.schedule);
22
+ }
23
+ else {
24
+ _this.isScheduling = false;
25
+ }
14
26
  });
15
27
  }
16
- else {
17
- window.setTimeout(_this.schedule);
18
- }
19
28
  };
20
- this.schedule();
21
29
  }
22
30
  FrozenTaskManager.prototype.getRunningTask = function () {
23
31
  if (this.tasks[0] && this.tasks[0].status === "running") {
@@ -38,6 +46,9 @@ var FrozenTaskManager = /** @class */ (function () {
38
46
  else {
39
47
  this.tasks = this.tasks.filter(function (v) { return v.type !== type; });
40
48
  this.tasks.push(task);
49
+ if (!this.isScheduling) {
50
+ this.schedule();
51
+ }
41
52
  }
42
53
  };
43
54
  FrozenTaskManager.prototype.destroy = function () {
package/lib/Slide.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { SlideError, ILoaderDelegate } from "@netless/ppt-player";
2
+ import { useSlidePlugin } from "@netless/plugin-system";
2
3
  export { ErrorType } from "@netless/ppt-player";
3
4
  export type { ILoaderDelegate } from "@netless/ppt-player";
4
5
  export interface RtcAudio {
@@ -118,9 +119,9 @@ export interface ISlideRenderOptions {
118
119
  * 用于设置最高显示分辨率。此值不仅影响 canvas 渲染分辨率, 同时也影响纹理质量,
119
120
  * 在低端设备, 降低此值能极大改善内存占用及图片黑屏现象.
120
121
  * [1] 最低 960 * 540, 小于 1 按 1 计算;
121
- * [2] 普通 1280 * 720; 移动端默认设置.
122
- * [3] 高清 1920 * 1080; pc 端默认设置.
123
- * [4] 3K 3200 × 1800, 大于 4 按 4 计算;
122
+ * [2] 普通 1280 * 720; --- 移动端默认设置.
123
+ * [3] 高清 1920 * 1080;
124
+ * [4] 3K 3200 × 1800, 大于 4 按 4 计算; --- pc 端默认设置.
124
125
  * 默认情况下, pc 设备 3K, 移动设备 720P
125
126
  */
126
127
  maxResolutionLevel?: number;
@@ -296,6 +297,7 @@ export declare class Slide extends Slide_base {
296
297
  static _tempLog: string;
297
298
  static _tempLogIndex: number;
298
299
  static flushLog(): Promise<void>;
300
+ static usePlugin: typeof useSlidePlugin;
299
301
  private iosResetCache;
300
302
  private iosNewPlayer?;
301
303
  private needClearCacheImage;
@@ -338,7 +340,8 @@ export declare class Slide extends Slide_base {
338
340
  private _dispatchIncrId;
339
341
  private _receiveIncrId;
340
342
  private get dispatchIncrId();
341
- constructor(config: ISlideConfig);
343
+ constructor(initConfig: ISlideConfig);
344
+ initSlideConfig(config: ISlideConfig): ISlideConfig;
342
345
  static handleLogDownload: () => Promise<void>;
343
346
  private initPlayer;
344
347
  private userInputHandle;