aliyun-rtc-sdk 7.1.0-beta.1 → 7.1.0
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/aliyun-rtc-sdk.es.js +3139 -2601
- package/dist/aliyun-rtc-sdk.umd.js +14 -14
- package/dist/plugins/audioProcessPlugin.d.ts +5504 -0
- package/dist/plugins/audioProcessPlugin.js +160 -0
- package/dist/plugins/beautyPlugin.d.ts +915 -5
- package/dist/plugins/beautyPlugin.js +1 -1
- package/dist/plugins/index-BGdMdvjC.js +1 -0
- package/dist/types/index.d.ts +23 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{h as r}from"./index-BGdMdvjC.js";import{QueenEngineWorker as a,kQueenVersion as o}from"aliyun-queen-engine";import"eventemitter3";var u=Object.defineProperty,c=(t,e,n)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i=(t,e,n)=>c(t,typeof e!="symbol"?e+"":e,n);class d extends r{constructor(){super("AliRtcBeauty"),i(this,"engineReady",!1),i(this,"_queenEngine"),i(this,"canvas"),i(this,"dirty",!1),i(this,"lastFrameTimestamp",0),i(this,"continuousStuckCount",0),this.zIndex=0}get initOptions(){return{licenseKey:""}}setOptions(e){const n=!!e.segmentBackgroundProcess?.enable,s=!!e.setSegmentBackgroundImage?.backgroundImgUrl;this.options={...this.options,...e},s?delete this.options.segmentBackgroundProcess:n&&delete this.options.setSegmentBackgroundImage,this.engineReady&&this.queenEngine?.setEngineParams(this.options)}async init(){await this.initQueen()}isSupported(){const e=!(typeof TransformStream>"u"||typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u"),n=!(typeof OffscreenCanvas>"u"||typeof WebGL2RenderingContext>"u"),s=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));return e&&n&&s}async initQueen(){this.canvas=document.createElement("canvas");const{licenseKey:e=""}=this.options,n=new a(o.Pro);return this._queenEngine=n,await new Promise(s=>{n.init(e,()=>{this.engineReady=!0,this.emit("ready"),n.setEngineParams(this.options),s(n)},function(){},this.canvas)}),n}shouldUpdate(e){return this.videoUpdated(e)||this.dirty}async process(e){if(!e.originVideoTrack){this.clear(e),e.updateVideoTrack();return}if(!this.queenEngine||!this.engineReady)return;this.dirty=!1;const n=this.queenEngine.renderMediaStreamTrack(e.originVideoTrack);n&&e.updateVideoTrack(n)}get queenEngine(){return this._queenEngine}clear(e){this.canvas=void 0,this.engineReady=!1,this._queenEngine=void 0,this.queenEngine?.engineDestory(),super.clear(e)}}export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"eventemitter3";var u;(function(t){t[t.AliRtcSdkStreamTypeCapture=0]="AliRtcSdkStreamTypeCapture",t[t.AliRtcSdkStreamTypeScreen=1]="AliRtcSdkStreamTypeScreen"})(u||(u={}));var d=u,h=Object.defineProperty,o=(t,i,a)=>i in t?h(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a,e=(t,i,a)=>o(t,typeof i!="symbol"?i+"":i,a),c;(function(t){t[t.PRE_PROCESSOR=0]="PRE_PROCESSOR",t[t.POST_PROCESSOR=1]="POST_PROCESSOR"})(c||(c={}));var s;(function(t){t[t.AUDIO=0]="AUDIO",t[t.VIDEO=1]="VIDEO",t[t.BOTH=2]="BOTH"})(s||(s={}));class p extends n{constructor(i,a=d.AliRtcSdkStreamTypeCapture,r=s.VIDEO){super(),e(this,"name"),e(this,"options"),e(this,"type",c.PRE_PROCESSOR),e(this,"streamType"),e(this,"trackType"),e(this,"zIndex",1),e(this,"_isEnable",!0),e(this,"lastInputAudioTrack"),e(this,"lastOutputAudioTrack"),e(this,"lastInputVideoTrack"),e(this,"lastOutputVideoTrack"),e(this,"_hasCleared",!0),this.name=i,this.streamType=a,this.trackType=r,this.options=this.initOptions}get initOptions(){return{}}getOptions(){return this.options}async init(){}enable(){this._isEnable||(this._isEnable=!0,this.init(),this.emit("enabled"))}disable(){this._isEnable&&(this._isEnable=!1,this.clear(),this.emit("disabled"))}get isEnable(){return this._isEnable}audioUpdated(i){return this.lastInputAudioTrack?.id!==i.currentAudioTrack?.id}videoUpdated(i){return this.lastInputVideoTrack?.id!==i.currentVideoTrack?.id}async execute(i,a){const r=this.shouldUpdate(i,a);this.lastInputAudioTrack=i.currentAudioTrack,this.lastInputVideoTrack=i.currentVideoTrack,this._hasCleared||r?(await this.process(i,a),this._hasCleared=!1):(this.lastOutputAudioTrack&&(this.trackType===s.BOTH||this.trackType===s.AUDIO)&&this.lastOutputAudioTrack&&i.updateAudioTrack(this.lastOutputAudioTrack),this.lastOutputVideoTrack&&(this.trackType===s.BOTH||this.trackType===s.VIDEO)&&this.lastOutputVideoTrack&&i.updateVideoTrack(this.lastOutputVideoTrack)),this.lastOutputAudioTrack=i.currentAudioTrack,this.lastOutputVideoTrack=i.currentVideoTrack}clear(i){this._hasCleared=!0,this.lastInputAudioTrack=void 0,this.lastInputVideoTrack=void 0,this.lastOutputAudioTrack=void 0,this.lastOutputVideoTrack=void 0}}export{s as A,d as C,p as h};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -347,7 +347,8 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
347
347
|
* @note 该接口只可以在加入频道之前调用,会议中不可以重新设置,离开频道后可以重新设置
|
|
348
348
|
*/
|
|
349
349
|
setChannelProfile(channelProfile: AliRtcSdkChannelProfile): void;
|
|
350
|
-
private
|
|
350
|
+
private startDefaultDevices;
|
|
351
|
+
private startPublish;
|
|
351
352
|
/**
|
|
352
353
|
* 设置用户角色
|
|
353
354
|
* @param {AliRtcSdkClientRole} clientRole 用户角色类型,默认值为 {@link AliRtcSdkClientRole.AliRtcSdkLive}(观众角色)
|
|
@@ -948,6 +949,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
948
949
|
* @param option 插件初始化参数值,请阅读插件库接入文档
|
|
949
950
|
*/
|
|
950
951
|
setPluginOption(name: string, option: any): void;
|
|
952
|
+
getPluginByName(name: string): any;
|
|
951
953
|
/**
|
|
952
954
|
* @brief 根据插件ID获取插件内部信息
|
|
953
955
|
* @param name 插件名称,通过 plugin.name 获取
|
|
@@ -2006,6 +2008,8 @@ declare interface AliRtcRemoteVideoStats {
|
|
|
2006
2008
|
}
|
|
2007
2009
|
|
|
2008
2010
|
declare interface AliRtcScreenShareConfiguration {
|
|
2011
|
+
width?: number;
|
|
2012
|
+
height?: number;
|
|
2009
2013
|
frameRate?: number;
|
|
2010
2014
|
bitrate?: number;
|
|
2011
2015
|
}
|
|
@@ -2245,6 +2249,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2245
2249
|
private audioMixerPlugin?;
|
|
2246
2250
|
private dualVideoPlugin?;
|
|
2247
2251
|
private blankAudioPlugin?;
|
|
2252
|
+
private audioProcessorPlugin?;
|
|
2248
2253
|
protected slsReporter: SLSReporter;
|
|
2249
2254
|
private statsMonitorId?;
|
|
2250
2255
|
private autoSubAudio;
|
|
@@ -2260,6 +2265,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2260
2265
|
private audioVolumeIndicationInterval;
|
|
2261
2266
|
private indicationTimer;
|
|
2262
2267
|
private parameter;
|
|
2268
|
+
private audio3AConfig;
|
|
2263
2269
|
private dcReadyHelper?;
|
|
2264
2270
|
constructor(config: BizControlConfig);
|
|
2265
2271
|
private addSignalingManagerListener;
|
|
@@ -2388,6 +2394,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2388
2394
|
setEnableMediaExtensionMsg(enable: boolean): void;
|
|
2389
2395
|
setAudioRedEnabled(enable: boolean): void;
|
|
2390
2396
|
setParameter(parameter: string): void;
|
|
2397
|
+
private setupAudioProcessingPluginIfNeeded;
|
|
2391
2398
|
getParameter(): string;
|
|
2392
2399
|
sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
|
|
2393
2400
|
}
|
|
@@ -2544,6 +2551,7 @@ declare interface ISendPackage {
|
|
|
2544
2551
|
channelprofile: AliRtcSdkChannelProfile;
|
|
2545
2552
|
};
|
|
2546
2553
|
auth?: SendPackageAuthInfo;
|
|
2554
|
+
adapt?: PackageAdaptInfo;
|
|
2547
2555
|
sessionid?: string;
|
|
2548
2556
|
pushstreamurl?: string;
|
|
2549
2557
|
users?: any[];
|
|
@@ -2571,6 +2579,7 @@ declare interface JoinResult {
|
|
|
2571
2579
|
tid: string;
|
|
2572
2580
|
users: JoinInfo[];
|
|
2573
2581
|
timestamp: number;
|
|
2582
|
+
config: any;
|
|
2574
2583
|
}
|
|
2575
2584
|
|
|
2576
2585
|
declare interface LeaveInfo {
|
|
@@ -2724,6 +2733,7 @@ declare class LocalUser extends User {
|
|
|
2724
2733
|
protected streamTracks?: TrackInfo[];
|
|
2725
2734
|
protected publishId: string;
|
|
2726
2735
|
protected signalingManager: SignalingManager;
|
|
2736
|
+
private shouldPublish;
|
|
2727
2737
|
traceId: string;
|
|
2728
2738
|
private monitorTimerId?;
|
|
2729
2739
|
private monitorDataCache;
|
|
@@ -3053,12 +3063,23 @@ declare interface OSSToken {
|
|
|
3053
3063
|
expiration: number;
|
|
3054
3064
|
}
|
|
3055
3065
|
|
|
3066
|
+
declare interface PackageAdaptInfo {
|
|
3067
|
+
os_name: string;
|
|
3068
|
+
device_name: string;
|
|
3069
|
+
brand_name: string;
|
|
3070
|
+
device_key: string;
|
|
3071
|
+
os_version: string;
|
|
3072
|
+
sdk_version: string;
|
|
3073
|
+
version: string;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3056
3076
|
declare class PackageCreater {
|
|
3057
3077
|
protected authInfo: AliRtcAuthInfo;
|
|
3058
3078
|
protected userName: string;
|
|
3059
3079
|
protected seqIndex: number;
|
|
3060
3080
|
constructor(authInfo: AliRtcAuthInfo, userName: string);
|
|
3061
3081
|
get roleAuth(): SendPackageAuthInfo | undefined;
|
|
3082
|
+
get adaptInfo(): PackageAdaptInfo | undefined;
|
|
3062
3083
|
refreshAuthInfo(authInfo: AliRtcAuthInfo): void;
|
|
3063
3084
|
getSeqIndex(): number;
|
|
3064
3085
|
/**
|
|
@@ -4128,6 +4149,7 @@ declare class SLSReporter {
|
|
|
4128
4149
|
* 断开连接
|
|
4129
4150
|
*/
|
|
4130
4151
|
stop(): void;
|
|
4152
|
+
reportPublishAudio3A(callId: string, msid: string, traceId: string, apmJson: string): void;
|
|
4131
4153
|
reportPublishMonitor(callId: string, traceId: string, msid: string, track: MediaStreamTrack | undefined, stats: any[]): void;
|
|
4132
4154
|
reportSubscribeMonitor(callId: string, remoteId: string, traceId: string, msid: string, stats: any[]): void;
|
|
4133
4155
|
reportNetworkMonitor(candidates: any[]): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliyun-rtc-sdk",
|
|
3
|
-
"version": "7.1.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "rtc web sdk of aliyun",
|
|
6
6
|
"main": "dist/aliyun-rtc-sdk.umd.js",
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
"@aliyun-sls/web-sts-plugin": "^0.3.5",
|
|
11
11
|
"@aliyun-sls/web-track-browser": "^0.3.5",
|
|
12
12
|
"aliyun-queen-engine": "^6.3.3",
|
|
13
|
-
"aliyun-rts-sdk": "2.12.
|
|
13
|
+
"aliyun-rts-sdk": "2.12.5",
|
|
14
14
|
"crypto-js": "^4.1.1",
|
|
15
15
|
"dateformat": "^5.0.3",
|
|
16
16
|
"eventemitter3": "^5.0.1",
|
|
17
|
+
"ua-parser-js": "1.0.40",
|
|
17
18
|
"uuid": "^10.0.0"
|
|
18
19
|
},
|
|
19
20
|
"homepage": "https://help.aliyun.com/zh/live/user-guide/quick-use",
|