media-av 0.0.7 → 0.0.9

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/index.d.ts CHANGED
@@ -29,17 +29,39 @@ export interface IRtspPullSession {
29
29
  stop(): void;
30
30
  }
31
31
 
32
- /**
33
- * 初始化video模块
34
- * @param baseUrl{string} http(s)://ip:port
35
- */
36
- export declare function videoModuleInit(baseUrl: string): void;
32
+ export interface BroadcastSessionListener {
33
+
34
+ /**
35
+ * 视频推送时会上报
36
+ * @param stream
37
+ */
38
+ onAddLocalStream(stream: MediaStream): void
39
+
40
+ /**
41
+ * 错误回调
42
+ * @param err{Error}
43
+ */
44
+ onError(err: Error): void
45
+ }
46
+
47
+ export interface IBroadcastSession {
48
+ /**
49
+ * 添加回调监听
50
+ * @param listener 监听器
51
+ */
52
+ setBroadcastSessionListener(listener: BroadcastSessionListener): void;
53
+
54
+ /**
55
+ * 开始广播
56
+ */
57
+ start(): void;
58
+
59
+ /**
60
+ * 停止广播
61
+ */
62
+ stop(): void;
63
+ }
37
64
 
38
- /**
39
- * 创建rtsp拉流会话
40
- * @param rtspUrl{string} rtsp地址
41
- */
42
- export declare function createRtspPullSession(rtspUrl: string): IRtspPullSession;
43
65
 
44
66
  type CallDirect = "in" | "out";
45
67
 
@@ -227,4 +249,24 @@ export declare function voipModuleInit(baseUrl: string): void;
227
249
  * 创建呼叫会话
228
250
  * @param tel 本端号码
229
251
  */
230
- export declare function createCallSession(tel?: string): ICallSession;
252
+ export declare function createCallSession(tel?: string): ICallSession;
253
+
254
+ /**
255
+ * 初始化video模块
256
+ * @param baseUrl{string} http(s)://ip:port
257
+ */
258
+ export declare function videoModuleInit(baseUrl: string): void;
259
+
260
+ /**
261
+ * 创建rtsp拉流会话
262
+ * @param rtspUrl{string} rtsp地址
263
+ */
264
+ export declare function createRtspPullSession(rtspUrl: string): IRtspPullSession;
265
+
266
+
267
+ /**
268
+ * 创建广播会话
269
+ * @param tel 广播号码
270
+ * @param mediaType 广播类型, 默认 audio
271
+ */
272
+ export declare function createBroadcastSession(tel: string, mediaType?: MediaType): IBroadcastSession;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "media-av",
3
3
  "private": false,
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "type": "module",
6
6
  "author": "W.w.",
7
7
  "license": "MIT",