ソースを参照

更新版本到 1.4.11

ChangeLog
1. 增加 replaceTrack 方法,可替换发布流中的音频或视频轨道
2. 增加 connection-state-change 的事件通知,连接断开时,将尝试自动重连
3. 增加 isSupportWebRTC 方法,可用于初步检测浏览器是否支持 WebRTC
3. 修复 macOS 系统在切换屏幕时发布流中声音消失的问题
4. 将 Client 中的 deviceDetection 方法转移到 UCloudRTC 中
5. 其它内部优化
kevin.song 5 年 前
コミット
5d1c7e77e5
3 ファイル変更144 行追加40 行削除
  1. 126 38
      README.md
  2. 1 1
      package.json
  3. 17 1
      types/index.d.ts

ファイルの差分が大きいため隠しています
+ 126 - 38
README.md


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "urtc-sdk",
-  "version": "1.4.10",
+  "version": "1.4.11",
   "description": "UCloud RTC javascript SDK",
   "main": "lib/index.js",
   "repository": {

+ 17 - 1
types/index.d.ts

@@ -8,7 +8,10 @@ export declare type DeviceType = 'audio'|'video';
 // 业务方使用的事件类型
 export declare type EventType = 'user-added' | 'user-removed' |
   'stream-added' | 'stream-removed' | 'stream-published' | 'stream-subscribed' |
-  'mute-video' | 'unmute-video' | 'mute-audio' | 'unmute-audio' | 'screenshare-stopped';
+  'mute-video' | 'unmute-video' | 'mute-audio' | 'unmute-audio' | 'screenshare-stopped' |
+  'connection-state-change';
+
+export declare type ConnectionState = 'OPEN' | 'CONNECTING' | 'CLOSING' | 'RECONNECTING' | 'CLOSED';
 
 export declare type WaterMarkPosition = 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom'; // 左上,左下,右上,右下
 export declare type WaterMarkType = 'time' | 'image' | 'text';
@@ -49,6 +52,13 @@ export interface DeviceDetectionOptions {
   cameraId?: string       // 选填,指定需要检测的摄像头设备的ID,可以通过 getCameras 方法查询获得该ID,不填时,将检测默认的摄像头设备
 }
 
+export interface DeviceDetectionResult {
+  audio: boolean
+  audioError?: string
+  video: boolean
+  videoError?: string
+}
+
 export interface User {
   uid: string     // 用户ID
 }
@@ -159,3 +169,9 @@ export interface VideoStats {
 export interface NetworkStats {
   rtt: number
 }
+
+export interface ReplaceTrackOptions {
+  streamId?: string
+  track: MediaStreamTrack
+  retain?: boolean
+}