Browse Source

更新版本到 1.4.15

ChangeLog
1. 新增 AddMixStream 和 RemoveMixStream 方法
2. 修复错误日志上报问题
3. 发布流的视频编码格式默认使用 h264,发布前自动检测浏览器支持的视频编码格式,并自动调整
4. 对于使用移动设备进行发布视频流时,支持指定前置或后置摄像头
5. 其他内部优化
kevin.song 5 years ago
parent
commit
daa62784b1
4 changed files with 101 additions and 5 deletions
  1. 79 1
      README.md
  2. 2 2
      lib/index.js
  3. 1 1
      package.json
  4. 19 1
      types/index.d.ts

File diff suppressed because it is too large
+ 79 - 1
README.md


File diff suppressed because it is too large
+ 2 - 2
lib/index.js


+ 1 - 1
package.json

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

+ 19 - 1
types/index.d.ts

@@ -22,7 +22,7 @@ export declare type NetworkQuality = '0' | '1' | '2' | '3' | '4' | '5' | '6';
 export interface ClientOptions {
   type?: RoomType
   role?: UserRole
-  codec?: VideoCodec  // 可设 vp8 或 h264,默认为 vp8
+  codec?: VideoCodec  // 可设 vp8 或 h264,默认为 h264
 }
 
 export interface Codecs {
@@ -30,9 +30,12 @@ export interface Codecs {
   video: Array<VideoCodec>
 }
 
+declare type FacingMode = 'user' | 'environment' | 'left' | 'right';
+
 export interface PublishOptions {
   audio: boolean    // 是否开启麦克风
   video: boolean    // 是否开启摄像头
+  facingMode?: FacingMode
   screen: boolean   // 是否共享屏幕
   microphoneId?: string // 麦克风设备ID
   cameraId?: string     // 摄像头设备ID
@@ -223,6 +226,8 @@ export interface MixOptions {
   backgroundColor?: BackgroundColorOptions
 
   waterMark?: WaterMarkOptions
+
+  streams?: MixStream[]
 }
 
 export interface StopMixOptions {
@@ -235,3 +240,16 @@ export interface MixResult {
   Type?: MixType
   PushURL?: string[]
 }
+
+export interface MixStream {
+  uid: string,        // 用户 ID
+  mediaType: 'camera'|'screen'   // 流的媒体类型
+}
+
+export interface AddMixStreamsOptions {
+  streams: MixStream[]
+}
+
+export interface RemoveMixStreamsOptions {
+  streams: MixStream[]
+}