Browse Source

更新版本到 1.4.14

ChangeLog
1. 修复日志上报时报错的问题
2. 优化自动重连功能
3. 新增 startMix, stopMix, queryMix 方法,以支持录制转推
4. 其他内部优化
kevin.song 5 years ago
parent
commit
c8a3857729
4 changed files with 232 additions and 6 deletions
  1. 169 1
      README.md
  2. 3 3
      lib/index.js
  3. 1 1
      package.json
  4. 59 1
      types/index.d.ts

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


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


+ 1 - 1
package.json

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

+ 59 - 1
types/index.d.ts

@@ -176,4 +176,62 @@ export interface ReplaceTrackOptions {
   streamId?: string
   track: MediaStreamTrack
   retain?: boolean
-}
+}
+
+export declare type MixType = 'relay' | 'record' | 'relay-and-record' | 'update-config'
+export declare type MixLayoutType = 'flow' | 'main' | 'custom'
+export declare type MixAudioCodec = 'aac'
+export declare type MixVideoCodec = 'h264' | 'h265'
+export declare type H264Quality = 'B' | 'CB' | 'M' | 'E' | 'H'
+
+export interface MixLayoutOptions {
+  type: MixLayoutType           // layout 类型
+  custom?: Object[]             // layout 为 'custom',自定义布局填在custom里,格式参照RFC5707 Media Server Markup Language (MSML)
+  mainViewUId?: string          // 指定某用户的流为主画面
+  mainViewType?: MainViewType   // 主画面类型
+}
+
+export interface MixAudioOptions {
+  codec: MixAudioCodec
+}
+
+export interface MixVideoOptions {
+  codec: MixVideoCodec
+  quality?: H264Quality       // 当 codec 为 h264 时,此项起作用
+  frameRate?: number
+  bitRate?: number
+}
+
+export interface BackgroundColorOptions {
+  r: number
+  g: number
+  b: number
+}
+
+export interface MixOptions {
+  type?: MixType            // 默认为 record
+  bucket?: string
+  region?: string
+
+  pushURL?: string[]     // type 是 转推,转推和录制时,需指定
+  layout?: MixLayoutOptions
+  audio?: MixAudioOptions
+  video?: MixVideoOptions
+
+  width?: number
+  height?: number
+  backgroundColor?: BackgroundColorOptions
+
+  waterMark?: WaterMarkOptions
+}
+
+export interface StopMixOptions {
+  type?: MixType            // 默认为 record
+}
+
+export interface MixResult {
+  MixId: string
+  FileName?: string
+  Type?: MixType
+  PushURL?: string[]
+}