aliyun-rtc-sdk 7.0.0 → 7.0.1
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 +2987 -2484
- package/dist/aliyun-rtc-sdk.umd.js +14 -14
- package/dist/plugins/audioProcessPlugin.d.ts +5497 -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 +18 -0
- package/package.json +3 -1
|
@@ -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
|
@@ -948,6 +948,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
948
948
|
* @param option 插件初始化参数值,请阅读插件库接入文档
|
|
949
949
|
*/
|
|
950
950
|
setPluginOption(name: string, option: any): void;
|
|
951
|
+
getPluginByName(name: string): any;
|
|
951
952
|
/**
|
|
952
953
|
* @brief 根据插件ID获取插件内部信息
|
|
953
954
|
* @param name 插件名称,通过 plugin.name 获取
|
|
@@ -2245,6 +2246,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2245
2246
|
private audioMixerPlugin?;
|
|
2246
2247
|
private dualVideoPlugin?;
|
|
2247
2248
|
private blankAudioPlugin?;
|
|
2249
|
+
private audioProcessorPlugin?;
|
|
2248
2250
|
protected slsReporter: SLSReporter;
|
|
2249
2251
|
private statsMonitorId?;
|
|
2250
2252
|
private autoSubAudio;
|
|
@@ -2260,6 +2262,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2260
2262
|
private audioVolumeIndicationInterval;
|
|
2261
2263
|
private indicationTimer;
|
|
2262
2264
|
private parameter;
|
|
2265
|
+
private audio3AConfig;
|
|
2263
2266
|
private dcReadyHelper?;
|
|
2264
2267
|
constructor(config: BizControlConfig);
|
|
2265
2268
|
private addSignalingManagerListener;
|
|
@@ -2388,6 +2391,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2388
2391
|
setEnableMediaExtensionMsg(enable: boolean): void;
|
|
2389
2392
|
setAudioRedEnabled(enable: boolean): void;
|
|
2390
2393
|
setParameter(parameter: string): void;
|
|
2394
|
+
private setupAudioProcessingPluginIfNeeded;
|
|
2391
2395
|
getParameter(): string;
|
|
2392
2396
|
sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
|
|
2393
2397
|
}
|
|
@@ -2544,6 +2548,7 @@ declare interface ISendPackage {
|
|
|
2544
2548
|
channelprofile: AliRtcSdkChannelProfile;
|
|
2545
2549
|
};
|
|
2546
2550
|
auth?: SendPackageAuthInfo;
|
|
2551
|
+
adapt?: PackageAdaptInfo;
|
|
2547
2552
|
sessionid?: string;
|
|
2548
2553
|
pushstreamurl?: string;
|
|
2549
2554
|
users?: any[];
|
|
@@ -2570,6 +2575,7 @@ declare interface JoinResult {
|
|
|
2570
2575
|
tid: string;
|
|
2571
2576
|
users: JoinInfo[];
|
|
2572
2577
|
timestamp: number;
|
|
2578
|
+
config: any;
|
|
2573
2579
|
}
|
|
2574
2580
|
|
|
2575
2581
|
declare interface LeaveInfo {
|
|
@@ -3051,12 +3057,23 @@ declare interface OSSToken {
|
|
|
3051
3057
|
expiration: number;
|
|
3052
3058
|
}
|
|
3053
3059
|
|
|
3060
|
+
declare interface PackageAdaptInfo {
|
|
3061
|
+
os_name: string;
|
|
3062
|
+
device_name: string;
|
|
3063
|
+
brand_name: string;
|
|
3064
|
+
device_key: string;
|
|
3065
|
+
os_version: string;
|
|
3066
|
+
sdk_version: string;
|
|
3067
|
+
version: string;
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3054
3070
|
declare class PackageCreater {
|
|
3055
3071
|
protected authInfo: AliRtcAuthInfo;
|
|
3056
3072
|
protected userName: string;
|
|
3057
3073
|
protected seqIndex: number;
|
|
3058
3074
|
constructor(authInfo: AliRtcAuthInfo, userName: string);
|
|
3059
3075
|
get roleAuth(): SendPackageAuthInfo | undefined;
|
|
3076
|
+
get adaptInfo(): PackageAdaptInfo | undefined;
|
|
3060
3077
|
refreshAuthInfo(authInfo: AliRtcAuthInfo): void;
|
|
3061
3078
|
getSeqIndex(): number;
|
|
3062
3079
|
/**
|
|
@@ -4125,6 +4142,7 @@ declare class SLSReporter {
|
|
|
4125
4142
|
* 断开连接
|
|
4126
4143
|
*/
|
|
4127
4144
|
stop(): void;
|
|
4145
|
+
reportPublishAudio3A(callId: string, msid: string, traceId: string, apmJson: string): void;
|
|
4128
4146
|
reportPublishMonitor(callId: string, traceId: string, msid: string, track: MediaStreamTrack | undefined, stats: any[]): void;
|
|
4129
4147
|
reportSubscribeMonitor(callId: string, remoteId: string, traceId: string, msid: string, stats: any[]): void;
|
|
4130
4148
|
reportNetworkMonitor(candidates: any[]): void;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliyun-rtc-sdk",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "rtc web sdk of aliyun",
|
|
6
6
|
"main": "dist/aliyun-rtc-sdk.umd.js",
|
|
7
7
|
"module": "dist/aliyun-rtc-sdk.es.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
+
"@ali/aliyun-audio-3a": "^0.0.5",
|
|
10
11
|
"@aliyun-sls/web-sts-plugin": "^0.3.5",
|
|
11
12
|
"@aliyun-sls/web-track-browser": "^0.3.5",
|
|
12
13
|
"aliyun-queen-engine": "^6.3.3",
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"crypto-js": "^4.1.1",
|
|
15
16
|
"dateformat": "^5.0.3",
|
|
16
17
|
"eventemitter3": "^5.0.1",
|
|
18
|
+
"ua-parser-js": "1.0.40",
|
|
17
19
|
"uuid": "^10.0.0"
|
|
18
20
|
},
|
|
19
21
|
"homepage": "https://help.aliyun.com/zh/live/user-guide/quick-use",
|