@vmosedge/web-sdk 1.2.6 → 1.3.0-beta.1

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.
@@ -308,6 +308,7 @@ interface VmosEdgeClientOptions {
308
308
  retryInterval?: number;
309
309
  videoCodecPreference?: "no-preference" | "prefer-hardware" | "prefer-software";
310
310
  renderPreference?: "default" | "high-performance" | "low-power";
311
+ decoderType?: "webcodecs" | "tinyh264";
311
312
  hoverMoveKeep?: boolean;
312
313
  scrollSpeedRatio?: number;
313
314
  enableRightClickBack?: boolean;
@@ -347,17 +348,11 @@ declare class VmosEdgeClient extends EventEmitter {
347
348
  private deviceTouchGroupMap;
348
349
  private config;
349
350
  private mediaType;
350
- private renderer;
351
- private videoCodecPreference;
352
- private renderPreference;
353
351
  private scrollSpeedRatio;
354
352
  private hoverMoveKeep;
355
353
  private enableRightClickBack;
356
354
  private enableMiddleClickHome;
357
355
  private onInternalError;
358
- private decoder;
359
- private audioPlayer;
360
- private textareaManager;
361
356
  private videoWidth;
362
357
  private videoHeight;
363
358
  private isRunning;
@@ -365,34 +360,29 @@ declare class VmosEdgeClient extends EventEmitter {
365
360
  private manualRotation;
366
361
  private currentRotationAngle;
367
362
  private resizeObserver;
363
+ private textareaManager;
364
+ private decoderType;
368
365
  private retryCount;
369
366
  private maxRetries;
370
367
  private retryInterval;
371
- private isVideoRecovering;
372
- private isAudioRecovering;
373
- private isTouchRecovering;
374
- private videoRetryCount;
375
- private audioRetryCount;
376
- private touchRetryCount;
377
368
  private pendingVideoKeyframeRequest;
378
369
  private lastChannelStateMap;
379
370
  private stopVideoSubscription;
380
- private stopAudioSubscription;
381
371
  private stopTouchSubscription;
382
- private audioStartPromise;
383
- private audioLifecycleVersion;
384
- private static PointerEventButtonToAndroidButton;
372
+ private coordinator;
373
+ private instanceId;
374
+ private videoPipeline;
375
+ private audioPipeline;
376
+ private inputManager;
377
+ private touchRecoverer;
385
378
  static isWebCodecsSupported(): boolean;
386
379
  constructor(options: VmosEdgeClientOptions);
387
380
  private reportInternalError;
388
381
  private setupConnectionListener;
389
382
  private shouldEnableAudio;
390
383
  private emitChannelState;
391
- private emitAudioError;
392
- private updateMediaType;
393
384
  private setupChannelStatusListener;
394
385
  private initCanvas;
395
- private replaceCanvas;
396
386
  private initTextareaManager;
397
387
  private observeContainerResize;
398
388
  on<T extends VmosEdgeClientEventName>(event: T, listener: VmosEdgeClientEventListener<T>): this;
@@ -402,19 +392,17 @@ declare class VmosEdgeClient extends EventEmitter {
402
392
  start(): Promise<void>;
403
393
  private connectWithRetry;
404
394
  private internalStart;
405
- private startVideoPipeline;
406
- private getAudioErrorDetails;
407
- private isAudioLifecycleCurrent;
408
- private stopAudioPipelineInternal;
409
- private startAudioPipeline;
410
- private recoverVideoChannel;
411
- private recoverAudioChannel;
412
- private recoverTouchChannel;
413
- private createVideoStream;
395
+ private startAudioPipelineNew;
414
396
  private createAudioStream;
397
+ private routeCommand;
398
+ private sendTouch;
399
+ private requestVideoKeyframe;
400
+ private flushPendingVideoKeyframeRequest;
401
+ private buildPipelineCallbacks;
402
+ private createVideoStream;
415
403
  private setupTouchBlocking;
416
404
  private performHandshake;
417
- private performAudioHandshake;
405
+ private recoverTouchChannel;
418
406
  setGroupControlMode(enabled: boolean): void;
419
407
  joinGroupControl(config: VmosEdgeClientConfig[]): void;
420
408
  leaveGroupControl(config: VmosEdgeClientConfig[]): void;
@@ -422,20 +410,7 @@ declare class VmosEdgeClient extends EventEmitter {
422
410
  enableAudio(): Promise<void>;
423
411
  disableAudio(): void;
424
412
  private emitSizeChanged;
425
- private mapCoordinates;
426
413
  private updateCanvasSize;
427
- private createRenderer;
428
- private bindInputEvents;
429
- private unbindInputEvents;
430
- private handleContextMenu;
431
- private handlePointerEvent;
432
- private sendTouch;
433
- private requestVideoKeyframe;
434
- private flushPendingVideoKeyframeRequest;
435
- private handleWheelEvent;
436
- updateScrollSensitivity(speedRatio: number): void;
437
- setHoverMoveKeep(enabled: boolean): void;
438
- sendText(text: string): void;
439
414
  sendKeyCode(keyCode: AndroidKeyCode, action: AndroidKeyEventAction, metaState?: number): void;
440
415
  clickKey(keyCode: AndroidKeyCode, metaState?: AndroidMetaState): void;
441
416
  volumeUp(): void;
@@ -443,6 +418,11 @@ declare class VmosEdgeClient extends EventEmitter {
443
418
  home(): void;
444
419
  back(): void;
445
420
  menu(): void;
421
+ sendText(text: string): void;
422
+ updateScrollSensitivity(speedRatio: number): void;
423
+ setHoverMoveKeep(enabled: boolean): void;
424
+ setRightClickBackEnabled(enabled: boolean): void;
425
+ setMiddleClickHomeEnabled(enabled: boolean): void;
446
426
  setRotation(rotation: 0 | 1): void;
447
427
  getRotation(): 0 | 1;
448
428
  getRunningState(): boolean;
@@ -452,9 +432,12 @@ declare class VmosEdgeClient extends EventEmitter {
452
432
  };
453
433
  getConfig(): VmosEdgeClientConfig | null;
454
434
  getScale(): number;
455
- setRightClickBackEnabled(enabled: boolean): void;
456
- setMiddleClickHomeEnabled(enabled: boolean): void;
435
+ getChannelStatus(): AllChannelsStatus | undefined;
436
+ snapshot(): Promise<ImageBitmap | undefined>;
437
+ resumeAudio(): Promise<void>;
457
438
  }
458
439
 
440
+ type DecoderType = "webcodecs" | "tinyh264";
441
+
459
442
  export { AndroidKeyCode, AndroidKeyEventAction, AndroidMetaState, AndroidMotionEventAction, AndroidMotionEventButton, VmosEdgeClient, VmosEdgeClientEvents, VmosEdgeErrorCode, VmosEdgeErrorType };
460
- export type { AllChannelsStatus, ChannelStatus, VmosEdgeChannelConnectedEvent, VmosEdgeChannelRuntimeStatus, VmosEdgeClientConfig, VmosEdgeClientEventListener, VmosEdgeClientEventMap, VmosEdgeClientEventName, VmosEdgeClientOptions, VmosEdgeErrorEvent, VmosEdgeReconnectingEvent, VmosEdgeSizeChangedEvent, VmosEdgeVideoDecoderStats };
443
+ export type { AllChannelsStatus, ChannelStatus, DecoderType, VmosEdgeChannelConnectedEvent, VmosEdgeChannelRuntimeStatus, VmosEdgeClientConfig, VmosEdgeClientEventListener, VmosEdgeClientEventMap, VmosEdgeClientEventName, VmosEdgeClientOptions, VmosEdgeErrorEvent, VmosEdgeReconnectingEvent, VmosEdgeSizeChangedEvent, VmosEdgeVideoDecoderStats };
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@vmosedge/web-sdk",
3
- "version": "1.2.6",
4
- "main": "./dist/index.cjs.js",
5
- "module": "./dist/index.es.js",
6
- "types": "./dist/types/index.d.ts",
7
- "scripts": {},
3
+ "version": "1.3.0-beta.1",
4
+ "main": "./src/index.ts",
5
+ "module": "./src/index.ts",
6
+ "types": "./src/index.ts",
7
+ "scripts": {
8
+ "build": "rimraf dist && rollup --config rollup.config.ts --configPlugin typescript"
9
+ },
8
10
  "files": [
9
11
  "dist"
10
12
  ],
@@ -25,13 +27,30 @@
25
27
  "author": "ask",
26
28
  "license": "ISC",
27
29
  "description": "Vmos Edge Web SDK",
28
- "dependencies": {},
29
- "devDependencies": {},
30
- "exports": {
31
- ".": {
32
- "types": "./dist/types/index.d.ts",
33
- "import": "./dist/index.es.js",
34
- "require": "./dist/index.cjs.js"
35
- }
30
+ "dependencies": {
31
+ "@yume-chan/async": "^4.1.3",
32
+ "@yume-chan/event": "^2.0.0",
33
+ "@yume-chan/scrcpy": "^2.3.0",
34
+ "@yume-chan/stream-extra": "^2.1.0",
35
+ "tinyh264": "^0.0.7",
36
+ "yuv-buffer": "^1.0.1",
37
+ "yuv-canvas": "^1.3.0"
38
+ },
39
+ "devDependencies": {
40
+ "@babel/core": "^7.25.2",
41
+ "@babel/preset-env": "^7.25.3",
42
+ "@rollup/plugin-alias": "^6.0.0",
43
+ "@rollup/plugin-babel": "^6.0.4",
44
+ "@rollup/plugin-commonjs": "^26.0.1",
45
+ "@rollup/plugin-json": "^6.1.0",
46
+ "@rollup/plugin-node-resolve": "^15.2.3",
47
+ "@rollup/plugin-replace": "^6.0.3",
48
+ "@rollup/plugin-terser": "^0.4.4",
49
+ "@rollup/plugin-typescript": "^11.1.6",
50
+ "esbuild": "^0.27.2",
51
+ "rimraf": "^6.0.1",
52
+ "rollup": "^4.46.4",
53
+ "rollup-plugin-dts": "^6.2.3",
54
+ "tslib": "^2.6.3"
36
55
  }
37
56
  }