janus-simple-videoroom-client 1.0.4 → 2.0.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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,51 @@
1
- import { JanusMediaOptions, JanusMessage, JanusMid, JanusPluginHandle, JanusPublishOptions, JanusSessionOptions, JanusStreamSpec, JanusSubscriberConfigureOptions, JanusWatchOptions, Jsep } from "./janus";
1
+ import Janus, { JanusJS } from "janus-gateway";
2
+ export { Janus };
3
+ type JanusMid = unknown;
4
+ interface JanusMessage {
5
+ [key: string]: any;
6
+ }
7
+ interface JanusMediaOptions {
8
+ tracks?: JanusJS.TrackOption[];
9
+ trickle?: boolean;
10
+ stream?: MediaStream;
11
+ customizeSdp?: (jsep: JanusJS.JSEP) => void;
12
+ customizeRemoteSdp?: (jsep: JanusJS.JSEP) => void;
13
+ }
14
+ interface JanusStreamSpec {
15
+ feed: unknown;
16
+ mid?: JanusMid;
17
+ }
18
+ interface JanusWatchOptions {
19
+ pin?: string;
20
+ media?: string[];
21
+ }
22
+ interface JanusPublishOptions {
23
+ audiocodec?: string;
24
+ videocodec?: string;
25
+ bitrate?: number;
26
+ record?: boolean;
27
+ filename?: string;
28
+ display?: string;
29
+ audio_level_average?: number;
30
+ audio_active_packets?: number;
31
+ descriptions?: {
32
+ mid: JanusMid;
33
+ description: string;
34
+ }[];
35
+ }
36
+ interface JanusSubscriberConfigureOptions {
37
+ mid?: JanusMid;
38
+ send?: boolean;
39
+ substream?: number;
40
+ temporal?: number;
41
+ fallback?: number;
42
+ spatial_layer?: number;
43
+ temporal_layer?: number;
44
+ audio_level_average?: number;
45
+ audio_active_packets?: number;
46
+ }
2
47
  export interface VideoRoomClient {
3
- createSession(server: string | string[], options?: JanusSessionOptions): Promise<VideoRoomSession>;
48
+ createSession(server: string | string[], options?: Partial<JanusJS.ConstructorOptions>): Promise<VideoRoomSession>;
4
49
  }
5
50
  export interface VideoRoomSession {
6
51
  eventTarget: ReturnType<typeof makeEventTarget>;
@@ -64,26 +109,29 @@ export interface StreamingSubscriber {
64
109
  }): Promise<void>;
65
110
  unsubscribe(): Promise<void>;
66
111
  }
67
- export interface JanusPluginHandleEx extends JanusPluginHandle {
112
+ export interface JanusPluginHandleEx extends JanusJS.PluginHandle {
68
113
  eventTarget: ReturnType<typeof makeEventTarget>;
69
- sendRequest(message: JanusMessage): Promise<JanusMessage>;
114
+ sendRequest(message: JanusMessage & {
115
+ request: string;
116
+ }): Promise<JanusMessage>;
70
117
  sendAsyncRequest(options: {
71
- message: JanusMessage;
72
- jsep?: Jsep;
118
+ message: JanusMessage & {
119
+ request: string;
120
+ };
121
+ jsep?: JanusJS.JSEP;
73
122
  expectResponse: (response: AsyncResponse) => boolean;
74
123
  }): Promise<AsyncResponse>;
124
+ handleRemoteJsep(params: JanusJS.PluginHandleRemoteJsepParam & {
125
+ customizeSdp?: (jsep: JanusJS.JSEP) => void;
126
+ }): void;
75
127
  }
76
128
  interface AsyncResponse {
77
129
  message: JanusMessage;
78
- jsep?: Jsep;
130
+ jsep?: JanusJS.JSEP;
79
131
  }
80
- export declare function createVideoRoomClient(options?: {
81
- debug?: boolean | string[];
82
- dependencies?: unknown;
83
- }): Promise<VideoRoomClient>;
132
+ export declare function createVideoRoomClient(options?: JanusJS.InitOptions): Promise<VideoRoomClient>;
84
133
  declare function makeEventTarget(): {
85
134
  addEventListener(name: string, callback: (event: CustomEvent) => void): void;
86
135
  removeEventListener(name: string, callback: (event: CustomEvent) => void): void;
87
136
  dispatchEvent(event: Event): void;
88
137
  };
89
- export {};