@agora-js/media 4.23.0 → 4.23.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/media.d.ts CHANGED
@@ -363,6 +363,10 @@ export declare interface AudioEncoderConfiguration {
363
363
  */
364
364
  export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
365
365
 
366
+ export declare interface AudioMetadata {
367
+ value: Uint8Array;
368
+ }
369
+
366
370
  export declare interface AudioPlaybackOptions {
367
371
  /**
368
372
  * 控制人声是否要被播放,默认为 `true`
@@ -2879,11 +2883,21 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
2879
2883
  setEnabled(enabled: boolean): Promise<void>;
2880
2884
  }
2881
2885
 
2882
- export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
2886
+ declare interface InterceptAudioFrameOptions {
2887
+ enableTopn?: boolean;
2888
+ enableMetadata?: boolean;
2889
+ onMetadata?: (metadata: Uint8Array) => void;
2890
+ }
2891
+
2892
+ declare interface InterceptAudioFrameOptions_2 {
2893
+ metadata?: () => Uint8Array | undefined;
2894
+ }
2895
+
2896
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender, options?: InterceptAudioFrameOptions_2): Promise<void>;
2883
2897
 
2884
2898
  export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
2885
2899
 
2886
- export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
2900
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, options?: InterceptAudioFrameOptions): Promise<void>;
2887
2901
 
2888
2902
  export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
2889
2903
 
@@ -3462,6 +3476,7 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
3462
3476
  readonly trackMediaType: "audio" | "video";
3463
3477
  _encoderConfig?: AudioEncoderConfiguration;
3464
3478
  _trackSource: AudioTrackSource | FakeTrackSource;
3479
+ metadata: AudioMetadata[];
3465
3480
  /**
3466
3481
  * @description This method is used to init WebAudio, if you're sure you don't want to use WebAudio, call _trackSource
3467
3482
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-js/media",
3
- "version": "4.23.0",
3
+ "version": "4.23.1",
4
4
  "description": "media module across @agora-js packages",
5
5
  "main": "AgoraRTC_N-media.js",
6
6
  "module": "AgoraRTC_N-media.esm.mjs",
@@ -23,8 +23,8 @@
23
23
  "homepage": "https://api-ref.agora.io/en/voice-sdk/web/4.x/index.html",
24
24
  "peerDependencies": {},
25
25
  "dependencies": {
26
- "@agora-js/shared": "4.23.0",
27
- "@agora-js/report": "4.23.0",
26
+ "@agora-js/shared": "4.23.1",
27
+ "@agora-js/report": "4.23.1",
28
28
  "axios": "^1.7.7",
29
29
  "agora-rte-extension": "^1.2.4",
30
30
  "webrtc-adapter": "8.2.0"
@@ -229,6 +229,10 @@ export declare interface AudioEncoderConfiguration {
229
229
  */
230
230
  export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
231
231
 
232
+ export declare interface AudioMetadata {
233
+ value: Uint8Array;
234
+ }
235
+
232
236
  export declare interface AudioPlaybackOptions {
233
237
  origin?: boolean;
234
238
  mixing?: boolean;
@@ -1766,11 +1770,21 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
1766
1770
  setEnabled(enabled: boolean): Promise<void>;
1767
1771
  }
1768
1772
 
1769
- export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
1773
+ declare interface InterceptAudioFrameOptions {
1774
+ enableTopn?: boolean;
1775
+ enableMetadata?: boolean;
1776
+ onMetadata?: (metadata: Uint8Array) => void;
1777
+ }
1778
+
1779
+ declare interface InterceptAudioFrameOptions_2 {
1780
+ metadata?: () => Uint8Array | undefined;
1781
+ }
1782
+
1783
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender, options?: InterceptAudioFrameOptions_2): Promise<void>;
1770
1784
 
1771
1785
  export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
1772
1786
 
1773
- export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
1787
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, options?: InterceptAudioFrameOptions): Promise<void>;
1774
1788
 
1775
1789
  export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
1776
1790
 
@@ -2099,6 +2113,7 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
2099
2113
  readonly trackMediaType: "audio" | "video";
2100
2114
  _encoderConfig?: AudioEncoderConfiguration;
2101
2115
  _trackSource: AudioTrackSource | FakeTrackSource;
2116
+ metadata: AudioMetadata[];
2102
2117
  get _source(): AudioTrackSource;
2103
2118
  set _source(source: AudioTrackSource | FakeTrackSource);
2104
2119
  _enabled: boolean;