yjz-web-sdk 1.0.9-beta.3 → 1.0.9-beta.5

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.
@@ -26,6 +26,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
26
26
  startPlayTrack: (track: MediaStreamTrack) => void;
27
27
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
28
  loadedSuccess: (...args: any[]) => void;
29
+ loadedFailure: (...args: any[]) => void;
29
30
  channelEvent: (...args: any[]) => void;
30
31
  groupControlEvent: (...args: any[]) => void;
31
32
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
@@ -41,6 +42,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
41
42
  isGroup: boolean;
42
43
  }>>> & Readonly<{
43
44
  onLoadedSuccess?: (...args: any[]) => any;
45
+ onLoadedFailure?: (...args: any[]) => any;
44
46
  onChannelEvent?: (...args: any[]) => any;
45
47
  onGroupControlEvent?: (...args: any[]) => any;
46
48
  }>, {
@@ -7,19 +7,3 @@ export interface TouchEventData {
7
7
  clientY: number;
8
8
  timeStamp: DOMHighResTimeStamp;
9
9
  }
10
- export type FrameId = bigint;
11
- export interface PendingFrame {
12
- width: number;
13
- height: number;
14
- label: string;
15
- totalChunks: number;
16
- receivedChunks: Set<number>;
17
- chunks: Map<number, Uint8Array>;
18
- }
19
- export interface VideoCFrame {
20
- frameId: FrameId;
21
- width: number;
22
- height: number;
23
- label: string;
24
- data: Uint8Array;
25
- }
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'vue';
2
2
  import { Dimension } from '../components/RemotePlayer/type';
3
- export default function useRemoteVideo(videoContainer: Ref<HTMLElement | null>, remoteVideoElement: Ref<HTMLCanvasElement | null>, audioElement: Ref<HTMLAudioElement | null>, videoAngle: Ref<number>, emit: (event: 'loadedSuccess') => void): {
3
+ export default function useRemoteVideo(videoContainer: Ref<HTMLElement | null>, remoteVideoElement: Ref<HTMLCanvasElement | null>, audioElement: Ref<HTMLAudioElement | null>, videoAngle: Ref<number>, emit: (event: 'loadedSuccess' | 'loadedFailure', reason?: string) => void): {
4
4
  videoSize: import("vue").ComputedRef<{
5
5
  width: number;
6
6
  height: number;
@@ -53,6 +53,5 @@ export declare enum EmitType {
53
53
  screenshot = "screenshot",
54
54
  reconnect = "reconnect",
55
55
  groupError = "groupError",
56
- videoFrame = "videoFrame",
57
56
  arrayBuffer = "arrayBuffer"
58
57
  }
@@ -1,7 +1,7 @@
1
1
  export declare class Canvas2DRenderer {
2
2
  private canvas;
3
3
  private ctx;
4
- constructor(canvas: HTMLCanvasElement);
4
+ constructor(canvas: HTMLCanvasElement | OffscreenCanvas);
5
5
  render(frame: VideoFrame): void;
6
6
  /** 清空画布 */
7
7
  clear(): void;
@@ -6,7 +6,7 @@ export declare class WebGLRenderer {
6
6
  private vertexBuffer;
7
7
  static vertexShaderSource: string;
8
8
  static fragmentShaderSource: string;
9
- constructor(type: "webgl" | "webgl2", canvas: HTMLCanvasElement);
9
+ constructor(type: "webgl" | "webgl2", canvas: HTMLCanvasElement | OffscreenCanvas);
10
10
  private createProgram;
11
11
  render(frame: VideoFrame): void;
12
12
  /** 清空画布,但不销毁资源 */
@@ -8,7 +8,7 @@ export declare class WebGPURenderer {
8
8
  private sampler;
9
9
  static vertexShaderSource: string;
10
10
  static fragmentShaderSource: string;
11
- constructor(canvas: HTMLCanvasElement);
11
+ constructor(canvas: HTMLCanvasElement | OffscreenCanvas);
12
12
  start(): Promise<void>;
13
13
  render(frame: VideoFrame | HTMLVideoElement | HTMLCanvasElement | HTMLImageElement): Promise<void>;
14
14
  /** 清空画布 */
@@ -0,0 +1,13 @@
1
+ export interface RenderingCapabilities {
2
+ webgpu: boolean;
3
+ webgl2: boolean;
4
+ webgl1: boolean;
5
+ canvas2d: boolean;
6
+ best: RendererType;
7
+ }
8
+ export type RendererType = 'webgpu' | 'webgl2' | 'webgl1' | 'canvas2d' | 'none';
9
+ export interface DecoderSupportResult {
10
+ supported: boolean;
11
+ hardware: boolean;
12
+ software: boolean;
13
+ }
@@ -1,4 +1,5 @@
1
1
  import { AVCodecID } from "@libmedia/avutil";
2
+ import { DecoderSupportResult, RenderingCapabilities } from "../types";
2
3
  export declare function getWasm(type: 'decoder' | 'encoder', codecId?: AVCodecID): string;
3
4
  export declare enum VideoCodecType {
4
5
  H264 = "h264",
@@ -8,15 +9,10 @@ export declare enum VideoCodecType {
8
9
  AV1 = "av1"
9
10
  }
10
11
  export declare function isDecoderSupported(codec: VideoCodecType): Promise<boolean>;
12
+ export declare function checkDecoderSupport(codec: VideoCodecType): Promise<DecoderSupportResult>;
11
13
  export declare function isEncoderSupported(codec: VideoCodecType): Promise<boolean>;
12
14
  export declare const isWebGPUSupported: () => Promise<boolean>;
13
15
  export declare const isWebGL2Supported: (canvas?: HTMLCanvasElement) => boolean;
14
16
  export declare const isWebGL1Supported: (canvas?: HTMLCanvasElement) => boolean;
15
17
  export declare const isCanvas2DSupported: (canvas?: HTMLCanvasElement) => boolean;
16
- export declare const detectRenderingCapabilities: () => Promise<{
17
- webgpu: boolean;
18
- webgl2: boolean;
19
- webgl1: boolean;
20
- canvas2d: boolean;
21
- best: string;
22
- }>;
18
+ export declare const detectRenderingCapabilities: () => Promise<RenderingCapabilities>;