You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ts/Private/AgoraMediaPlayerTypes.ts
+1-1
Original file line number
Diff line number
Diff line change
@@ -404,7 +404,7 @@ export class MediaSource {
404
404
*/
405
405
autoPlay?: boolean;
406
406
/**
407
-
* Whether to cache the media file when it is being played:true:Enables caching.false: (Default) Disables caching.The SDK only supports caching on-demand streams.If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file.If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See CacheStatistics .
407
+
* Whether to cache the media file when it is being played:true:Enables caching.false: (Default) Disables caching.Agora only supports caching on-demand audio and video streams that are not transmitted in HLS protocol.If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file.If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See CacheStatistics .
Copy file name to clipboardExpand all lines: ts/Private/IAgoraLog.ts
+2-2
Original file line number
Diff line number
Diff line change
@@ -68,11 +68,11 @@ export enum LogFilterType {
68
68
*/
69
69
exportclassLogConfig{
70
70
/**
71
-
* The complete path of the log files. Ensure that the path for the log file exists and is writable. You can use this parameter to rename the log files.The default file path is:macOSIf Sandbox is enabled: App~/Library/Logs/agorasdk.log. For example, /Users/<username>/Library/Containers/<AppBundleIdentifier>/Data/Library/Logs/agorasdk.log.If Sandbox is disabled: ~/Library/Logs/agorasdk.log.Windows:C:\Users\<user_name>\AppData\Local\Agora\<process_name>\agorasdk.log。
71
+
* The complete path of the log files. Ensure that the path for the log file exists and is writable. You can use this parameter to rename the log files.The default path is:macOS:If Sandbox is enabled: App Sandbox/Library/Logs/agorasdk.log. For example, /Users/<username>/Library/Containers/<AppBundleIdentifier>/Data/Library/Logs/agorasdk.log.If Sandbox is disabled: ~/Library/Logs/agorasdk.logWindows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\agorasdk.log.
72
72
*/
73
73
filePath?: string;
74
74
/**
75
-
* The size (KB) of an agorasdk.log file. The value range is [128,1024]. The default value is 1,024 KB. If you set fileSizeInKByte to a value lower than 128 KB, the SDK adjusts it to 128 KB. If you set fileSizeInKBytes to a value higher than 1,024 KB, the SDK adjusts it to 1,024 KB.
75
+
* The size (KB) of an agorasdk.log file. The value range is [128,1024]. The default value is 1,024 KB. If you set fileSizeInKByte smaller than 128 KB, the SDK automatically adjusts it to 128 KB; if you set fileSizeInKByte greater than 1,024 KB, the SDK automatically adjusts it to 1,024 KB.
Copy file name to clipboardExpand all lines: ts/Private/IAgoraMediaEngine.ts
+16-6
Original file line number
Diff line number
Diff line change
@@ -84,10 +84,8 @@ export abstract class IMediaEngine {
84
84
/**
85
85
* Pushes the external audio frame.
86
86
*
87
-
* @param type The type of the audio recording device. See MediaSourceType .
88
87
* @param frame The external audio frame. See AudioFrame .
89
-
* @param wrap Whether to use the placeholder. Agora recommends using the default value.true: Use the placeholder.false: (Default) Do not use the placeholder.
90
-
* @param sourceId The ID of external audio source. If you want to publish a custom external audio source, set this parameter to the ID of the corresponding custom audio track you want to publish.
88
+
* @param trackId The audio track ID. If you want to publish a custom external audio source, set this parameter to the ID of the corresponding custom audio track you want to publish.
91
89
*
92
90
* @returns
93
91
* 0: Success.< 0: Failure.
@@ -127,7 +125,7 @@ export abstract class IMediaEngine {
127
125
* Call this method before joining a channel.
128
126
*
129
127
* @param enabled Whether to enable the external audio source:true: Enable the external audio source.false: (Default) Disable the external audio source.
130
-
* @param sampleRate The sample rate (Hz) of the external audio which can be set as 8000, 16000, 32000, 44100, or 48000.
128
+
* @param sampleRate The sample rate (Hz) of the external audio source which can be set as 8000, 16000, 32000, 44100, or 48000.
131
129
* @param channels The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
132
130
* @param sourceNumber The number of external audio sources. The value of this parameter should be larger than 0. The SDK creates a corresponding number of custom audio tracks based on this parameter value and names the audio tracks starting from 0. In ChannelMediaOptions , you can set publishCustomAudioSourceId to the audio track ID you want to publish.
133
131
* @param localPlayback Whether to play the external audio source:true: Play the external audio source.false: (Default) Do not play the external source.
@@ -145,15 +143,27 @@ export abstract class IMediaEngine {
145
143
): number;
146
144
147
145
/**
148
-
* @ignore
146
+
* Creates a customized audio track.
147
+
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:Call this method to create a video track and get the video track ID.In ChannelMediaOptions of each channel, set customVideoTrackId to the video track ID that you want to publish, and set publishCustomVideoTrack to true.If you call pushAudioFrame trackId as the video track ID set in step 2, you can publish the corresponding custom video source in multiple channels.
148
+
*
149
+
* @param trackType The type of the custom audio track. See AudioTrackType .
150
+
* @param config The configuration of the custom audio track. See AudioTrackConfig .
151
+
*
152
+
* @returns
153
+
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.If the method call fails, a negative value is returned.
149
154
*/
150
155
abstractcreateCustomAudioTrack(
151
156
trackType: AudioTrackType,
152
157
config: AudioTrackConfig
153
158
): number;
154
159
155
160
/**
156
-
* @ignore
161
+
* Destroys the specified video track.
162
+
*
163
+
* @param trackId The custom audio track ID returned in createCustomAudioTrack .
Copy file name to clipboardExpand all lines: ts/Private/IAgoraMediaPlayer.ts
+38-15
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ export abstract class IMediaPlayer {
31
31
* Opens the media resource.
32
32
* This method is called asynchronously.If you need to play a media file, make sure you receive the onPlayerSourceStateChanged callback reporting PlayerStateOpenCompleted before calling the play method to play the file.
33
33
*
34
-
* @param url The path of the media file. Both local path and online path are supported.On the Android platform, if you need to open a file in URI format, use open .
34
+
* @param url The path of the media file. Both local path and online path are supported.
35
35
* @param startPos The starting position (ms) for playback. Default value is 0.
36
36
*
37
37
* @returns
@@ -164,7 +164,13 @@ export abstract class IMediaPlayer {
164
164
abstractsetPlaybackSpeed(speed: number): number;
165
165
166
166
/**
167
-
* @ignore
167
+
* Selects the audio track used during playback.
168
+
* After getting the track index of the audio file, you can call this method to specify any track to play. For example, if different tracks of a multi-track file store songs in different languages, you can call this method to set the playback language.You need to call this method after calling getStreamInfo to get the audio stream index value.
169
+
*
170
+
* @param index The index of the audio track.
171
+
*
172
+
* @returns
173
+
* 0: Success.< 0: Failure.
168
174
*/
169
175
abstractselectAudioTrack(index: number): number;
170
176
@@ -198,7 +204,13 @@ export abstract class IMediaPlayer {
198
204
abstracttakeScreenshot(filename: string): number;
199
205
200
206
/**
201
-
* @ignore
207
+
* Gets the detailed information of the media stream.
208
+
* Call this method after calling getStreamCount .
209
+
*
210
+
* @param index The index of the media stream.
211
+
*
212
+
* @returns
213
+
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo .If the call fails, returns NULL.
@@ -315,17 +332,21 @@ export abstract class IMediaPlayer {
315
332
/**
316
333
* Registers an audio frame observer object.
317
334
*
335
+
* @param observer The audio frame observer, reporting the reception of each audio frame. See IAudioPcmFrameSink .
318
336
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType .
337
+
*
338
+
* @returns
339
+
* 0: Success.< 0: Failure.
319
340
*/
320
341
abstractregisterAudioFrameObserver(
321
342
observer: IAudioPcmFrameSink,
322
343
mode?: RawAudioFrameOpModeType
323
344
): number;
324
345
325
346
/**
326
-
* Unregisters an audio observer.
347
+
* Unregisters an audio frame observer.
327
348
*
328
-
* @param observer The audio observer. See IMediaPlayerAudioFrameObserver .
349
+
* @param observer The audio observer. See IAudioPcmFrameSink .
329
350
*
330
351
* @returns
331
352
* 0: Success.< 0: Failure.
@@ -366,9 +387,9 @@ export abstract class IMediaPlayer {
366
387
): number;
367
388
368
389
/**
369
-
* Unregisters the encoded audio frame observer.
390
+
* Unregisters the video frame observer.
370
391
*
371
-
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver .
392
+
* @param observer The video observer, reporting the reception of each video frame. See IVideoFrameObserver .
372
393
*
373
394
* @returns
374
395
* 0: Success.< 0: Failure.
@@ -394,7 +415,10 @@ export abstract class IMediaPlayer {
394
415
abstractgetPlayerSdkVersion(): string;
395
416
396
417
/**
397
-
* @ignore
418
+
* Gets the path of the media resource being played.
419
+
*
420
+
* @returns
421
+
* The path of the media resource being played.
398
422
*/
399
423
abstractgetPlaySrc(): string;
400
424
@@ -512,8 +536,7 @@ export abstract class IMediaPlayerCacheManager {
512
536
* You can call this method to delete a cached media file when the storage space for the cached files is about to reach its limit. After you call this method, the SDK deletes the cached media file that is least used.The cached media file currently being played will not be deleted.
513
537
*
514
538
* @returns
515
-
* 0: Success.
516
-
* < 0: Failure. See MediaPlayerError .
539
+
* 0: Success.< 0: Failure. See MediaPlayerError .
517
540
*/
518
541
abstractremoveOldCache(): number;
519
542
@@ -524,8 +547,7 @@ export abstract class IMediaPlayerCacheManager {
524
547
* @param uri The URI (Uniform Resource Identifier) of the media file to be deleted.
525
548
*
526
549
* @returns
527
-
* 0: Success.
528
-
* < 0: Failure. See MediaPlayerError .
550
+
* 0: Success.< 0: Failure. See MediaPlayerError .
529
551
*/
530
552
abstractremoveCacheByUri(uri: string): number;
531
553
@@ -557,7 +579,8 @@ export abstract class IMediaPlayerCacheManager {
557
579
* @param cacheSize The maximum size (bytes) of the aggregate storage space for cached media files. The default value is 1 GB.
Copy file name to clipboardExpand all lines: ts/Private/IAgoraMediaRecorder.ts
+16-9
Original file line number
Diff line number
Diff line change
@@ -5,30 +5,37 @@ import {
5
5
}from'./AgoraMediaBase';
6
6
7
7
/**
8
-
* Used for recording audio and video on the client.
9
-
* IMediaRecorder can record the following:
10
-
* The audio captured by the local microphone and encoded in AAC format.The video captured by the local camera and encoded by the SDK.
8
+
* This class provides APIs for local and remote recording.
11
9
*/
12
10
exportabstractclassIMediaRecorder{
13
11
/**
14
-
* Registers one IMediaRecorderObserver object.
15
-
* Make sure that IRtcEngine is initialized before you call this method.
12
+
* Registers one IMediaRecorderObserver oberver.
13
+
* This method is used to set the callbacks of audio and video recording, so as to notify the app of the recording status and information of the audio and video stream during recording.Before calling this method, ensure the following:The IRtcEngine object is created and initialized.The recording object is created through createMediaRecorder .
16
14
*
17
-
* @param connection The connection information. See RtcConnection .
18
-
* @param callback The callbacks for recording local audio and video streams. See IMediaRecorderObserver .
15
+
* @param callback The callbacks for recording audio and video streams. See IMediaRecorderObserver .
* You can call this method to enable the recording function. Agora supports recording the media streams of local and remote users at the same time.Before you call this method, ensure the following:The recording object is created through createMediaRecorder .The recording observer is registered through setMediaRecorderObserver .You have joined the channel which the remote user that you want to record is in.Supported formats of recording are listed as below:AAC-encoded audio captured by the microphone.Video captured by a camera and encoded in H.264 or H.265.Once the recording is started, if the video resolution is changed, the SDK stops the recording; if the sampling rate and audio channel changes, the SDK continues recording and generates audio files respectively.The SDK can generate a recording file only when it detects audio and video streams; when there are no audio and video streams to be recorded or the audio and video streams are interrupted for more than five seconds, the SDK stops the recording and triggers the onRecorderStateChanged(RecorderStateError, RecorderErrorNoStream) callback.If you want to record the media streams of the local user, ensure the role of the local user is set as broadcaster.If you want to record the media streams of a remote user, ensure you have subscribed to the user's media streams before starting the recording.
25
+
*
26
+
* @param config The recording configuration. See MediaRecorderConfiguration .
27
+
*
28
+
* @returns
29
+
* 0: Success.< 0: Failure.-2: The parameter is invalid. Ensure the following:The specified path of the recording file exists and is writable.The specified format of the recording file is supported.The maximum recording duration is correctly set.-4: IRtcEngine does not support the request. The recording is ongoing or the recording stops because an error occurs.-7: The method is called before IRtcEngine is initialized. Ensure the IMediaRecorder object is created before calling this method.
* After calling startRecording , if you want to stop the recording, you must call this method; otherwise, the generated recording files may not be playable.
36
+
*
37
+
* @returns
38
+
* 0: Success.< 0: Failure.-7: The method is called before IRtcEngine is initialized. Ensure the IMediaRecorder object is created before calling this method.
0 commit comments