aliyun-rtc-sdk 7.1.0-beta.1 → 7.1.1-beta.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 +3144 -2604
- package/dist/aliyun-rtc-sdk.umd.js +14 -14
- package/dist/plugins/audioProcessPlugin.d.ts +5505 -0
- package/dist/plugins/audioProcessPlugin.js +160 -0
- package/dist/plugins/beautyPlugin.d.ts +916 -5
- package/dist/plugins/beautyPlugin.js +1 -1
- package/dist/plugins/index-DJR7vMTn.js +1 -0
- package/dist/types/index.d.ts +24 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{o as r}from"./index-DJR7vMTn.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 h from"eventemitter3";var u;(function(t){t[t.AliRtcSdkStreamTypeCapture=0]="AliRtcSdkStreamTypeCapture",t[t.AliRtcSdkStreamTypeScreen=1]="AliRtcSdkStreamTypeScreen"})(u||(u={}));var d=u,o=Object.defineProperty,n=(t,i,a)=>i in t?o(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a,e=(t,i,a)=>n(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 h{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,"shouldCache",!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.shouldCache&&(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 o};
|
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 获取
|
|
@@ -1907,6 +1909,7 @@ export declare abstract class AliRtcPlugin extends default_2<AliRtcPluginListene
|
|
|
1907
1909
|
trackType: AliRtcPluginTrackType;
|
|
1908
1910
|
zIndex: number;
|
|
1909
1911
|
private _isEnable;
|
|
1912
|
+
protected shouldCache: boolean;
|
|
1910
1913
|
lastInputAudioTrack?: MediaStreamTrack;
|
|
1911
1914
|
lastOutputAudioTrack?: MediaStreamTrack;
|
|
1912
1915
|
lastInputVideoTrack?: MediaStreamTrack;
|
|
@@ -2006,6 +2009,8 @@ declare interface AliRtcRemoteVideoStats {
|
|
|
2006
2009
|
}
|
|
2007
2010
|
|
|
2008
2011
|
declare interface AliRtcScreenShareConfiguration {
|
|
2012
|
+
width?: number;
|
|
2013
|
+
height?: number;
|
|
2009
2014
|
frameRate?: number;
|
|
2010
2015
|
bitrate?: number;
|
|
2011
2016
|
}
|
|
@@ -2245,6 +2250,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2245
2250
|
private audioMixerPlugin?;
|
|
2246
2251
|
private dualVideoPlugin?;
|
|
2247
2252
|
private blankAudioPlugin?;
|
|
2253
|
+
private audioProcessorPlugin?;
|
|
2248
2254
|
protected slsReporter: SLSReporter;
|
|
2249
2255
|
private statsMonitorId?;
|
|
2250
2256
|
private autoSubAudio;
|
|
@@ -2260,6 +2266,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2260
2266
|
private audioVolumeIndicationInterval;
|
|
2261
2267
|
private indicationTimer;
|
|
2262
2268
|
private parameter;
|
|
2269
|
+
private audio3AConfig;
|
|
2263
2270
|
private dcReadyHelper?;
|
|
2264
2271
|
constructor(config: BizControlConfig);
|
|
2265
2272
|
private addSignalingManagerListener;
|
|
@@ -2388,6 +2395,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2388
2395
|
setEnableMediaExtensionMsg(enable: boolean): void;
|
|
2389
2396
|
setAudioRedEnabled(enable: boolean): void;
|
|
2390
2397
|
setParameter(parameter: string): void;
|
|
2398
|
+
private setupAudioProcessingPluginIfNeeded;
|
|
2391
2399
|
getParameter(): string;
|
|
2392
2400
|
sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
|
|
2393
2401
|
}
|
|
@@ -2544,6 +2552,7 @@ declare interface ISendPackage {
|
|
|
2544
2552
|
channelprofile: AliRtcSdkChannelProfile;
|
|
2545
2553
|
};
|
|
2546
2554
|
auth?: SendPackageAuthInfo;
|
|
2555
|
+
adapt?: PackageAdaptInfo;
|
|
2547
2556
|
sessionid?: string;
|
|
2548
2557
|
pushstreamurl?: string;
|
|
2549
2558
|
users?: any[];
|
|
@@ -2571,6 +2580,7 @@ declare interface JoinResult {
|
|
|
2571
2580
|
tid: string;
|
|
2572
2581
|
users: JoinInfo[];
|
|
2573
2582
|
timestamp: number;
|
|
2583
|
+
config: any;
|
|
2574
2584
|
}
|
|
2575
2585
|
|
|
2576
2586
|
declare interface LeaveInfo {
|
|
@@ -2724,6 +2734,7 @@ declare class LocalUser extends User {
|
|
|
2724
2734
|
protected streamTracks?: TrackInfo[];
|
|
2725
2735
|
protected publishId: string;
|
|
2726
2736
|
protected signalingManager: SignalingManager;
|
|
2737
|
+
private shouldPublish;
|
|
2727
2738
|
traceId: string;
|
|
2728
2739
|
private monitorTimerId?;
|
|
2729
2740
|
private monitorDataCache;
|
|
@@ -3053,12 +3064,23 @@ declare interface OSSToken {
|
|
|
3053
3064
|
expiration: number;
|
|
3054
3065
|
}
|
|
3055
3066
|
|
|
3067
|
+
declare interface PackageAdaptInfo {
|
|
3068
|
+
os_name: string;
|
|
3069
|
+
device_name: string;
|
|
3070
|
+
brand_name: string;
|
|
3071
|
+
device_key: string;
|
|
3072
|
+
os_version: string;
|
|
3073
|
+
sdk_version: string;
|
|
3074
|
+
version: string;
|
|
3075
|
+
}
|
|
3076
|
+
|
|
3056
3077
|
declare class PackageCreater {
|
|
3057
3078
|
protected authInfo: AliRtcAuthInfo;
|
|
3058
3079
|
protected userName: string;
|
|
3059
3080
|
protected seqIndex: number;
|
|
3060
3081
|
constructor(authInfo: AliRtcAuthInfo, userName: string);
|
|
3061
3082
|
get roleAuth(): SendPackageAuthInfo | undefined;
|
|
3083
|
+
get adaptInfo(): PackageAdaptInfo | undefined;
|
|
3062
3084
|
refreshAuthInfo(authInfo: AliRtcAuthInfo): void;
|
|
3063
3085
|
getSeqIndex(): number;
|
|
3064
3086
|
/**
|
|
@@ -4128,6 +4150,7 @@ declare class SLSReporter {
|
|
|
4128
4150
|
* 断开连接
|
|
4129
4151
|
*/
|
|
4130
4152
|
stop(): void;
|
|
4153
|
+
reportPublishAudio3A(callId: string, msid: string, traceId: string, apmJson: string): void;
|
|
4131
4154
|
reportPublishMonitor(callId: string, traceId: string, msid: string, track: MediaStreamTrack | undefined, stats: any[]): void;
|
|
4132
4155
|
reportSubscribeMonitor(callId: string, remoteId: string, traceId: string, msid: string, stats: any[]): void;
|
|
4133
4156
|
reportNetworkMonitor(candidates: any[]): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliyun-rtc-sdk",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1-beta.1",
|
|
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",
|