aliyun-rtc-sdk 7.0.1 → 7.1.0-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.
@@ -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};
1
+ (function(a,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("eventemitter3"),require("aliyun-queen-engine")):typeof define=="function"&&define.amd?define(["eventemitter3","aliyun-queen-engine"],u):(a=typeof globalThis<"u"?globalThis:a||self,a.AliRtcBeautyPlugin=u(a.n,a.aliyunQueenEngine))})(this,function(a,u){"use strict";var c;(function(t){t[t.AliRtcSdkStreamTypeCapture=0]="AliRtcSdkStreamTypeCapture",t[t.AliRtcSdkStreamTypeScreen=1]="AliRtcSdkStreamTypeScreen"})(c||(c={}));var h=c,p=Object.defineProperty,l=(t,e,i)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,n=(t,e,i)=>l(t,typeof e!="symbol"?e+"":e,i),d;(function(t){t[t.PRE_PROCESSOR=0]="PRE_PROCESSOR",t[t.POST_PROCESSOR=1]="POST_PROCESSOR"})(d||(d={}));var r;(function(t){t[t.AUDIO=0]="AUDIO",t[t.VIDEO=1]="VIDEO",t[t.BOTH=2]="BOTH"})(r||(r={}));class T extends a{constructor(e,i=h.AliRtcSdkStreamTypeCapture,s=r.VIDEO){super(),n(this,"name"),n(this,"options"),n(this,"type",d.PRE_PROCESSOR),n(this,"streamType"),n(this,"trackType"),n(this,"zIndex",1),n(this,"_isEnable",!0),n(this,"lastInputAudioTrack"),n(this,"lastOutputAudioTrack"),n(this,"lastInputVideoTrack"),n(this,"lastOutputVideoTrack"),n(this,"_hasCleared",!0),this.name=e,this.streamType=i,this.trackType=s,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(e){return this.lastInputAudioTrack?.id!==e.currentAudioTrack?.id}videoUpdated(e){return this.lastInputVideoTrack?.id!==e.currentVideoTrack?.id}async execute(e,i){const s=this.shouldUpdate(e,i);this.lastInputAudioTrack=e.currentAudioTrack,this.lastInputVideoTrack=e.currentVideoTrack,this._hasCleared||s?(await this.process(e,i),this._hasCleared=!1):(this.lastOutputAudioTrack&&(this.trackType===r.BOTH||this.trackType===r.AUDIO)&&this.lastOutputAudioTrack&&e.updateAudioTrack(this.lastOutputAudioTrack),this.lastOutputVideoTrack&&(this.trackType===r.BOTH||this.trackType===r.VIDEO)&&this.lastOutputVideoTrack&&e.updateVideoTrack(this.lastOutputVideoTrack)),this.lastOutputAudioTrack=e.currentAudioTrack,this.lastOutputVideoTrack=e.currentVideoTrack}clear(e){this._hasCleared=!0,this.lastInputAudioTrack=void 0,this.lastInputVideoTrack=void 0,this.lastOutputAudioTrack=void 0,this.lastOutputVideoTrack=void 0}}var k=Object.defineProperty,y=(t,e,i)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,o=(t,e,i)=>y(t,typeof e!="symbol"?e+"":e,i);class g extends T{constructor(){super("AliRtcBeauty"),o(this,"engineReady",!1),o(this,"_queenEngine"),o(this,"canvas"),o(this,"dirty",!1),o(this,"lastFrameTimestamp",0),o(this,"continuousStuckCount",0),this.zIndex=0}get initOptions(){return{licenseKey:""}}setOptions(e){const i=!!e.segmentBackgroundProcess?.enable,s=!!e.setSegmentBackgroundImage?.backgroundImgUrl;this.options={...this.options,...e},s?delete this.options.segmentBackgroundProcess:i&&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"),i=!(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&&i&&s}async initQueen(){this.canvas=document.createElement("canvas");const{licenseKey:e=""}=this.options,i=new u.QueenEngineWorker(u.kQueenVersion.Pro);return this._queenEngine=i,await new Promise(s=>{i.init(e,()=>{this.engineReady=!0,this.emit("ready"),i.setEngineParams(this.options),s(i)},function(){},this.canvas)}),i}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 i=this.queenEngine.renderMediaStreamTrack(e.originVideoTrack);i&&e.updateVideoTrack(i)}get queenEngine(){return this._queenEngine}clear(e){this.canvas=void 0,this.engineReady=!1,this._queenEngine=void 0,this.queenEngine?.engineDestory(),super.clear(e)}}return g});
@@ -948,7 +948,6 @@ 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;
952
951
  /**
953
952
  * @brief 根据插件ID获取插件内部信息
954
953
  * @param name 插件名称,通过 plugin.name 获取
@@ -2246,7 +2245,6 @@ declare class BizControl extends default_2<BizControlListener> {
2246
2245
  private audioMixerPlugin?;
2247
2246
  private dualVideoPlugin?;
2248
2247
  private blankAudioPlugin?;
2249
- private audioProcessorPlugin?;
2250
2248
  protected slsReporter: SLSReporter;
2251
2249
  private statsMonitorId?;
2252
2250
  private autoSubAudio;
@@ -2262,7 +2260,6 @@ declare class BizControl extends default_2<BizControlListener> {
2262
2260
  private audioVolumeIndicationInterval;
2263
2261
  private indicationTimer;
2264
2262
  private parameter;
2265
- private audio3AConfig;
2266
2263
  private dcReadyHelper?;
2267
2264
  constructor(config: BizControlConfig);
2268
2265
  private addSignalingManagerListener;
@@ -2391,7 +2388,6 @@ declare class BizControl extends default_2<BizControlListener> {
2391
2388
  setEnableMediaExtensionMsg(enable: boolean): void;
2392
2389
  setAudioRedEnabled(enable: boolean): void;
2393
2390
  setParameter(parameter: string): void;
2394
- private setupAudioProcessingPluginIfNeeded;
2395
2391
  getParameter(): string;
2396
2392
  sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
2397
2393
  }
@@ -2548,7 +2544,6 @@ declare interface ISendPackage {
2548
2544
  channelprofile: AliRtcSdkChannelProfile;
2549
2545
  };
2550
2546
  auth?: SendPackageAuthInfo;
2551
- adapt?: PackageAdaptInfo;
2552
2547
  sessionid?: string;
2553
2548
  pushstreamurl?: string;
2554
2549
  users?: any[];
@@ -2571,11 +2566,11 @@ declare interface JoinInfo {
2571
2566
  }
2572
2567
 
2573
2568
  declare interface JoinResult {
2569
+ l1ip?: string;
2574
2570
  pushstreamurl: string;
2575
2571
  tid: string;
2576
2572
  users: JoinInfo[];
2577
2573
  timestamp: number;
2578
- config: any;
2579
2574
  }
2580
2575
 
2581
2576
  declare interface LeaveInfo {
@@ -2745,6 +2740,7 @@ declare class LocalUser extends User {
2745
2740
  constructor(config: LocalUserConfig);
2746
2741
  get url(): string;
2747
2742
  set url(value: string);
2743
+ set preferredPubL1Ip(value: string);
2748
2744
  get joined(): boolean;
2749
2745
  get isPublishing(): boolean;
2750
2746
  get publishStreams(): PublishStreamInfo;
@@ -3057,23 +3053,12 @@ declare interface OSSToken {
3057
3053
  expiration: number;
3058
3054
  }
3059
3055
 
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
-
3070
3056
  declare class PackageCreater {
3071
3057
  protected authInfo: AliRtcAuthInfo;
3072
3058
  protected userName: string;
3073
3059
  protected seqIndex: number;
3074
3060
  constructor(authInfo: AliRtcAuthInfo, userName: string);
3075
3061
  get roleAuth(): SendPackageAuthInfo | undefined;
3076
- get adaptInfo(): PackageAdaptInfo | undefined;
3077
3062
  refreshAuthInfo(authInfo: AliRtcAuthInfo): void;
3078
3063
  getSeqIndex(): number;
3079
3064
  /**
@@ -3893,6 +3878,7 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
3893
3878
  private dcConnectingPromise?;
3894
3879
  private _publishingTracks;
3895
3880
  private parameter;
3881
+ preferredPubL1Ip?: string;
3896
3882
  constructor(localStreamManager: LocalStreamManager, slsReporter: SLSReporter, parameter: Parameter);
3897
3883
  private addRTSListener;
3898
3884
  /**
@@ -4142,7 +4128,6 @@ declare class SLSReporter {
4142
4128
  * 断开连接
4143
4129
  */
4144
4130
  stop(): void;
4145
- reportPublishAudio3A(callId: string, msid: string, traceId: string, apmJson: string): void;
4146
4131
  reportPublishMonitor(callId: string, traceId: string, msid: string, track: MediaStreamTrack | undefined, stats: any[]): void;
4147
4132
  reportSubscribeMonitor(callId: string, remoteId: string, traceId: string, msid: string, stats: any[]): void;
4148
4133
  reportNetworkMonitor(candidates: any[]): void;
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "aliyun-rtc-sdk",
3
- "version": "7.0.1",
3
+ "version": "7.1.0-beta.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",
11
10
  "@aliyun-sls/web-sts-plugin": "^0.3.5",
12
11
  "@aliyun-sls/web-track-browser": "^0.3.5",
13
12
  "aliyun-queen-engine": "^6.3.3",
@@ -15,7 +14,6 @@
15
14
  "crypto-js": "^4.1.1",
16
15
  "dateformat": "^5.0.3",
17
16
  "eventemitter3": "^5.0.1",
18
- "ua-parser-js": "1.0.40",
19
17
  "uuid": "^10.0.0"
20
18
  },
21
19
  "homepage": "https://help.aliyun.com/zh/live/user-guide/quick-use",