agora-electron-sdk 4.2.0-dev.5 → 4.2.0-dev.8
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/js/AgoraSdk.js +4 -2
- package/js/Private/AgoraBase.js +1154 -6
- package/js/Private/AgoraMediaBase.js +308 -0
- package/js/Private/AgoraMediaPlayerTypes.js +112 -0
- package/js/Private/IAgoraLog.js +12 -0
- package/js/Private/IAgoraMediaStreamingSource.js +10 -0
- package/js/Private/IAgoraMusicContentCenter.js +104 -0
- package/js/Private/IAgoraRhythmPlayer.js +8 -0
- package/js/Private/IAgoraRtcEngine.js +843 -0
- package/js/Private/IAgoraRtcEngineEx.js +8 -0
- package/js/Private/IAgoraSpatialAudio.js +44 -0
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +59 -59
- package/js/Private/impl/IAgoraRtcEngineImpl.js +55 -46
- package/js/Private/internal/IrisApiEngine.js +7 -12
- package/js/Private/internal/MediaEngineInternal.js +7 -11
- package/js/Private/internal/MediaPlayerInternal.js +22 -20
- package/js/Private/internal/MediaRecorderInternal.js +4 -4
- package/js/Private/internal/MusicContentCenterInternal.js +7 -9
- package/js/Private/internal/RtcEngineExInternal.js +52 -62
- package/js/Renderer/AgoraView.js +21 -24
- package/js/Renderer/IRenderer.js +6 -13
- package/js/Renderer/IRendererManager.js +9 -0
- package/js/Renderer/RendererManager.js +49 -33
- package/js/Renderer/{GlRenderer → WebGLRenderer}/index.js +39 -45
- package/js/Renderer/YUVCanvasRenderer/index.js +8 -7
- package/js/Renderer/index.js +18 -0
- package/js/Utils.js +6 -8
- package/package.json +4 -3
- package/scripts/buildJS.js +1 -2
- package/scripts/getConfig.js +0 -1
- package/ts/AgoraSdk.ts +5 -2
- package/ts/Private/IAgoraMediaPlayer.ts +45 -45
- package/ts/Private/IAgoraRtcEngine.ts +33 -25
- package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +84 -84
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +75 -65
- package/ts/Private/internal/IrisApiEngine.ts +0 -2
- package/ts/Private/internal/RtcEngineExInternal.ts +23 -12
- package/ts/Renderer/AgoraView.ts +1 -0
- package/ts/Renderer/IRenderer.ts +8 -14
- package/ts/Renderer/IRendererManager.ts +35 -0
- package/ts/Renderer/RendererManager.ts +9 -9
- package/ts/Renderer/{GlRenderer → WebGLRenderer}/index.ts +26 -45
- package/ts/Renderer/YUVCanvasRenderer/index.ts +8 -10
- package/ts/Renderer/index.ts +2 -0
- package/ts/Types.ts +15 -9
- package/ts/Utils.ts +4 -6
- package/types/AgoraSdk.d.ts +4 -2
- package/types/AgoraSdk.d.ts.map +1 -0
- package/types/Private/AgoraBase.d.ts +1 -0
- package/types/Private/AgoraBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaBase.d.ts +1 -0
- package/types/Private/AgoraMediaBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaPlayerTypes.d.ts +1 -0
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -0
- package/types/Private/IAgoraLog.d.ts +1 -0
- package/types/Private/IAgoraLog.d.ts.map +1 -0
- package/types/Private/IAgoraMediaEngine.d.ts +1 -0
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayer.d.ts +35 -34
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayerSource.d.ts +1 -0
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -0
- package/types/Private/IAgoraMediaRecorder.d.ts +1 -0
- package/types/Private/IAgoraMediaRecorder.d.ts.map +1 -0
- package/types/Private/IAgoraMediaStreamingSource.d.ts +1 -0
- package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -0
- package/types/Private/IAgoraMusicContentCenter.d.ts +1 -0
- package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -0
- package/types/Private/IAgoraRhythmPlayer.d.ts +1 -0
- package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngine.d.ts +27 -19
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngineEx.d.ts +1 -0
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -0
- package/types/Private/IAgoraSpatialAudio.d.ts +1 -0
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -0
- package/types/Private/IAudioDeviceManager.d.ts +1 -0
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -0
- package/types/Private/extension/AgoraBaseExtension.d.ts +1 -0
- package/types/Private/extension/AgoraBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts +1 -0
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +1 -0
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraLogExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraLogExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts +1 -0
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts.map +1 -0
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts +1 -0
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts.map +1 -0
- package/types/Private/impl/AgoraBaseImpl.d.ts +1 -0
- package/types/Private/impl/AgoraBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts +1 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +9 -8
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +13 -10
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +1 -0
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -0
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts +1 -0
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts.map +1 -0
- package/types/Private/internal/AudioDeviceManagerInternal.d.ts +1 -0
- package/types/Private/internal/AudioDeviceManagerInternal.d.ts.map +1 -0
- package/types/Private/internal/IrisApiEngine.d.ts +8 -7
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -0
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +1 -0
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaEngineInternal.d.ts +1 -0
- package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaPlayerInternal.d.ts +1 -0
- package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaRecorderInternal.d.ts +1 -0
- package/types/Private/internal/MediaRecorderInternal.d.ts.map +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -0
- package/types/Private/internal/RtcEngineExInternal.d.ts +3 -2
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -0
- package/{js → types}/Private/internal/emitter/EventEmitter.d.ts +1 -0
- package/types/Private/internal/emitter/EventEmitter.d.ts.map +1 -0
- package/types/Private/ti/AgoraBase-ti.d.ts +1 -0
- package/types/Private/ti/AgoraBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts +1 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +1 -0
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraLog-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraLog-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts +1 -0
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts.map +1 -0
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts +1 -0
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts.map +1 -0
- package/types/Renderer/AgoraView.d.ts +1 -0
- package/types/Renderer/AgoraView.d.ts.map +1 -0
- package/types/Renderer/IRenderer.d.ts +6 -5
- package/types/Renderer/IRenderer.d.ts.map +1 -0
- package/types/Renderer/IRendererManager.d.ts +18 -0
- package/types/Renderer/IRendererManager.d.ts.map +1 -0
- package/types/Renderer/RendererManager.d.ts +5 -3
- package/types/Renderer/RendererManager.d.ts.map +1 -0
- package/types/Renderer/{GlRenderer → WebGLRenderer}/index.d.ts +9 -19
- package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -0
- package/types/Renderer/WebGLRenderer/webgl-utils.d.ts +1 -0
- package/types/Renderer/WebGLRenderer/webgl-utils.d.ts.map +1 -0
- package/types/Renderer/YUVCanvasRenderer/index.d.ts +4 -4
- package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -0
- package/types/Renderer/index.d.ts +3 -0
- package/types/Renderer/index.d.ts.map +1 -0
- package/types/Types.d.ts +15 -9
- package/types/Types.d.ts.map +1 -0
- package/types/Utils.d.ts +1 -0
- package/types/Utils.d.ts.map +1 -0
- package/js/AgoraSdk.d.ts +0 -36
- package/js/Private/AgoraBase.d.ts +0 -4441
- package/js/Private/AgoraMediaBase.d.ts +0 -1124
- package/js/Private/AgoraMediaPlayerTypes.d.ts +0 -408
- package/js/Private/IAgoraLog.d.ts +0 -80
- package/js/Private/IAgoraMediaEngine.d.ts +0 -183
- package/js/Private/IAgoraMediaPlayer.d.ts +0 -532
- package/js/Private/IAgoraMediaPlayerSource.d.ts +0 -82
- package/js/Private/IAgoraMediaRecorder.d.ts +0 -28
- package/js/Private/IAgoraMediaStreamingSource.d.ts +0 -41
- package/js/Private/IAgoraMusicContentCenter.d.ts +0 -335
- package/js/Private/IAgoraRhythmPlayer.d.ts +0 -64
- package/js/Private/IAgoraRtcEngine.d.ts +0 -4947
- package/js/Private/IAgoraRtcEngineEx.d.ts +0 -553
- package/js/Private/IAgoraSpatialAudio.d.ts +0 -265
- package/js/Private/IAudioDeviceManager.d.ts +0 -254
- package/js/Private/extension/AgoraBaseExtension.d.ts +0 -1
- package/js/Private/extension/AgoraMediaBaseExtension.d.ts +0 -1
- package/js/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +0 -1
- package/js/Private/extension/IAgoraLogExtension.d.ts +0 -1
- package/js/Private/extension/IAgoraMediaEngineExtension.d.ts +0 -40
- package/js/Private/extension/IAgoraMediaPlayerExtension.d.ts +0 -46
- package/js/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +0 -1
- package/js/Private/extension/IAgoraMediaRecorderExtension.d.ts +0 -44
- package/js/Private/extension/IAgoraMusicContentCenterExtension.d.ts +0 -20
- package/js/Private/extension/IAgoraRhythmPlayerExtension.d.ts +0 -1
- package/js/Private/extension/IAgoraRtcEngineExExtension.d.ts +0 -1
- package/js/Private/extension/IAgoraRtcEngineExtension.d.ts +0 -42
- package/js/Private/extension/IAgoraSpatialAudioExtension.d.ts +0 -1
- package/js/Private/extension/IAudioDeviceManagerExtension.d.ts +0 -1
- package/js/Private/impl/AgoraBaseImpl.d.ts +0 -2
- package/js/Private/impl/AgoraMediaBaseImpl.d.ts +0 -8
- package/js/Private/impl/IAgoraMediaEngineImpl.d.ts +0 -39
- package/js/Private/impl/IAgoraMediaPlayerImpl.d.ts +0 -140
- package/js/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +0 -2
- package/js/Private/impl/IAgoraMediaRecorderImpl.d.ts +0 -10
- package/js/Private/impl/IAgoraMusicContentCenterImpl.d.ts +0 -58
- package/js/Private/impl/IAgoraRtcEngineExImpl.d.ts +0 -105
- package/js/Private/impl/IAgoraRtcEngineImpl.d.ts +0 -570
- package/js/Private/impl/IAgoraSpatialAudioImpl.d.ts +0 -48
- package/js/Private/impl/IAudioDeviceManagerImpl.d.ts +0 -64
- package/js/Private/internal/AudioDeviceManagerInternal.d.ts +0 -8
- package/js/Private/internal/IrisApiEngine.d.ts +0 -147
- package/js/Private/internal/LocalSpatialAudioEngineInternal.d.ts +0 -18
- package/js/Private/internal/MediaEngineInternal.d.ts +0 -21
- package/js/Private/internal/MediaPlayerInternal.d.ts +0 -33
- package/js/Private/internal/MediaRecorderInternal.d.ts +0 -17
- package/js/Private/internal/MusicContentCenterInternal.d.ts +0 -39
- package/js/Private/internal/RtcEngineExInternal.d.ts +0 -80
- package/js/Private/ti/AgoraBase-ti.d.ts +0 -7
- package/js/Private/ti/AgoraMediaBase-ti.d.ts +0 -13
- package/js/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraLog-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraMediaEngine-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraMediaPlayer-ti.d.ts +0 -7
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +0 -7
- package/js/Private/ti/IAgoraMediaRecorder-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraMusicContentCenter-ti.d.ts +0 -7
- package/js/Private/ti/IAgoraRhythmPlayer-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraRtcEngine-ti.d.ts +0 -9
- package/js/Private/ti/IAgoraRtcEngineEx-ti.d.ts +0 -6
- package/js/Private/ti/IAgoraSpatialAudio-ti.d.ts +0 -6
- package/js/Private/ti/IAudioDeviceManager-ti.d.ts +0 -6
- package/js/Renderer/AgoraView.d.ts +0 -69
- package/js/Renderer/GlRenderer/index.d.ts +0 -59
- package/js/Renderer/GlRenderer/webgl-utils.d.ts +0 -0
- package/js/Renderer/IRenderer.d.ts +0 -21
- package/js/Renderer/RendererManager.d.ts +0 -152
- package/js/Renderer/YUVCanvasRenderer/index.d.ts +0 -16
- package/js/Types.d.ts +0 -271
- package/js/Utils.d.ts +0 -58
- /package/js/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +0 -0
- /package/ts/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +0 -0
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
import './extension/IAgoraMediaPlayerExtension';
|
|
2
|
-
import { SpatialAudioParams } from './AgoraBase';
|
|
3
|
-
import { AudioDualMonoMode, IAudioPcmFrameSink, IAudioSpectrumObserver, RawAudioFrameOpModeType, RenderModeType, VideoFrame } from './AgoraMediaBase';
|
|
4
|
-
import { MediaPlayerState, MediaSource, PlayerStreamInfo } from './AgoraMediaPlayerTypes';
|
|
5
|
-
import { IMediaPlayerSourceObserver } from './IAgoraMediaPlayerSource';
|
|
6
|
-
/**
|
|
7
|
-
* This class provides media player functions and supports multiple instances.
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class IMediaPlayer {
|
|
10
|
-
/**
|
|
11
|
-
* Gets the ID of the media player.
|
|
12
|
-
*
|
|
13
|
-
* @returns
|
|
14
|
-
* ≥ 0: Success. The ID of the media player.< 0: Failure.
|
|
15
|
-
*/
|
|
16
|
-
abstract getMediaPlayerId(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Opens the media resource.
|
|
19
|
-
* 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.
|
|
20
|
-
*
|
|
21
|
-
* @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 .
|
|
22
|
-
* @param startPos The starting position (ms) for playback. Default value is 0.
|
|
23
|
-
*
|
|
24
|
-
* @returns
|
|
25
|
-
* 0: Success.< 0: Failure.
|
|
26
|
-
*/
|
|
27
|
-
abstract open(url: string, startPos: number): number;
|
|
28
|
-
/**
|
|
29
|
-
* Opens a media file and configures the playback scenarios.
|
|
30
|
-
* This method supports opening media files of different sources, including a custom media source, and allows you to configure the playback scenarios.
|
|
31
|
-
*
|
|
32
|
-
* @param source Media resources. See MediaSource .
|
|
33
|
-
*
|
|
34
|
-
* @returns
|
|
35
|
-
* 0: Success.< 0: Failure.
|
|
36
|
-
*/
|
|
37
|
-
abstract openWithMediaSource(source: MediaSource): number;
|
|
38
|
-
/**
|
|
39
|
-
* Plays the media file.
|
|
40
|
-
* After calling open or seek, you can call this method to play the media file.
|
|
41
|
-
*
|
|
42
|
-
* @returns
|
|
43
|
-
* 0: Success.< 0: Failure.
|
|
44
|
-
*/
|
|
45
|
-
abstract play(): number;
|
|
46
|
-
/**
|
|
47
|
-
* Pauses the playback.
|
|
48
|
-
*
|
|
49
|
-
* @returns
|
|
50
|
-
* 0: Success.< 0: Failure.
|
|
51
|
-
*/
|
|
52
|
-
abstract pause(): number;
|
|
53
|
-
/**
|
|
54
|
-
* Stops playing the media track.
|
|
55
|
-
*
|
|
56
|
-
* @returns
|
|
57
|
-
* 0: Success.< 0: Failure.
|
|
58
|
-
*/
|
|
59
|
-
abstract stop(): number;
|
|
60
|
-
/**
|
|
61
|
-
* Resumes playing the media file.
|
|
62
|
-
*
|
|
63
|
-
* @returns
|
|
64
|
-
* 0: Success.< 0: Failure.
|
|
65
|
-
*/
|
|
66
|
-
abstract resume(): number;
|
|
67
|
-
/**
|
|
68
|
-
* Seeks to a new playback position.
|
|
69
|
-
* fter successfully calling this method, you will receive the onPlayerEvent callback, reporting the result of the seek operation to the new playback position.To play the media file from a specific position, do the following:Call this method to seek to the position you want to begin playback.Call the play method to play the media file.
|
|
70
|
-
*
|
|
71
|
-
* @param newPos The new playback position (ms).
|
|
72
|
-
*
|
|
73
|
-
* @returns
|
|
74
|
-
* 0: Success.< 0: Failure.
|
|
75
|
-
*/
|
|
76
|
-
abstract seek(newPos: number): number;
|
|
77
|
-
/**
|
|
78
|
-
* Sets the pitch of the current media resource.
|
|
79
|
-
* Call this method after calling open .
|
|
80
|
-
*
|
|
81
|
-
* @param pitch Sets the pitch of the local music file by the chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file.
|
|
82
|
-
*
|
|
83
|
-
* @returns
|
|
84
|
-
* 0: Success.< 0: Failure.
|
|
85
|
-
*/
|
|
86
|
-
abstract setAudioPitch(pitch: number): number;
|
|
87
|
-
/**
|
|
88
|
-
* Gets the duration of the media resource.
|
|
89
|
-
*
|
|
90
|
-
* @returns
|
|
91
|
-
* The total duration (ms) of the media file.
|
|
92
|
-
*/
|
|
93
|
-
abstract getDuration(): number;
|
|
94
|
-
/**
|
|
95
|
-
* Gets current local playback progress.
|
|
96
|
-
*
|
|
97
|
-
* @returns
|
|
98
|
-
* Returns the current playback progress (ms) if the call succeeds.< 0: Failure. See MediaPlayerError .
|
|
99
|
-
*/
|
|
100
|
-
abstract getPlayPosition(): number;
|
|
101
|
-
/**
|
|
102
|
-
* Gets the number of the media streams in the media resource.
|
|
103
|
-
* Call this method after calling open .
|
|
104
|
-
*
|
|
105
|
-
* @returns
|
|
106
|
-
* The number of the media streams in the media resource if the method call succeeds.< 0: Failure. See MediaPlayerError .
|
|
107
|
-
*/
|
|
108
|
-
abstract getStreamCount(): number;
|
|
109
|
-
/**
|
|
110
|
-
* Gets the detailed information of the media stream.
|
|
111
|
-
* Call this method after calling getStreamCount .
|
|
112
|
-
*
|
|
113
|
-
* @param index The index of the media stream.
|
|
114
|
-
*
|
|
115
|
-
* @returns
|
|
116
|
-
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo .If the call fails, returns NULL.
|
|
117
|
-
*/
|
|
118
|
-
abstract getStreamInfo(index: number): PlayerStreamInfo;
|
|
119
|
-
/**
|
|
120
|
-
* Sets the loop playback.
|
|
121
|
-
* If you want to loop, call this method and set the number of the loops.When the loop finishes, the SDK triggers onPlayerSourceStateChanged and reports the playback state as PlayerStatePlaybackAllLoopsCompleted.
|
|
122
|
-
*
|
|
123
|
-
* @param loopCount The number of times the audio effect loops:
|
|
124
|
-
*
|
|
125
|
-
* @returns
|
|
126
|
-
* 0: Success.< 0: Failure.
|
|
127
|
-
*/
|
|
128
|
-
abstract setLoopCount(loopCount: number): number;
|
|
129
|
-
/**
|
|
130
|
-
* Sets the channel mode of the current audio file.
|
|
131
|
-
* Call this method after calling open .
|
|
132
|
-
*
|
|
133
|
-
* @param speed The playback speed. Agora recommends that you limit this value to between 50 and 400, defined as follows:50: Half the original speed.100: The original speed.400: 4 times the original speed.
|
|
134
|
-
*
|
|
135
|
-
* @returns
|
|
136
|
-
* 0: Success.< 0: Failure.
|
|
137
|
-
*/
|
|
138
|
-
abstract setPlaybackSpeed(speed: number): number;
|
|
139
|
-
/**
|
|
140
|
-
* @ignore
|
|
141
|
-
*/
|
|
142
|
-
abstract selectAudioTrack(index: number): number;
|
|
143
|
-
/**
|
|
144
|
-
* Sets the private options for the media player.
|
|
145
|
-
* The media player supports setting private options by key and value. Under normal circumstances, you do not need to know the private option settings, and just use the default option settings.Ensure that you call this method before open .If you need to push streams with SEI into the CDN, call setPlayerOptionInInt("sei_data_with_uuid", 1); otherwise, the loss of SEI might occurs.
|
|
146
|
-
*
|
|
147
|
-
* @param key The key of the option.
|
|
148
|
-
* @param value The value of the key.
|
|
149
|
-
*
|
|
150
|
-
* @returns
|
|
151
|
-
* 0: Success.< 0: Failure.
|
|
152
|
-
*/
|
|
153
|
-
abstract setPlayerOptionInInt(key: string, value: number): number;
|
|
154
|
-
/**
|
|
155
|
-
* Sets the private options for the media player.
|
|
156
|
-
* The media player supports setting private options by key and value. Under normal circumstances, you do not need to know the private option settings, and just use the default option settings.Ensure that you call this method before open .If you need to push streams with SEI into the CDN, call setPlayerOptionInInt("sei_data_with_uuid", 1); otherwise, the loss of SEI might occurs.
|
|
157
|
-
*
|
|
158
|
-
* @param key The key of the option.
|
|
159
|
-
* @param value The value of the key.
|
|
160
|
-
*
|
|
161
|
-
* @returns
|
|
162
|
-
* 0: Success.< 0: Failure.
|
|
163
|
-
*/
|
|
164
|
-
abstract setPlayerOptionInString(key: string, value: string): number;
|
|
165
|
-
/**
|
|
166
|
-
* @ignore
|
|
167
|
-
*/
|
|
168
|
-
abstract takeScreenshot(filename: string): number;
|
|
169
|
-
/**
|
|
170
|
-
* @ignore
|
|
171
|
-
*/
|
|
172
|
-
abstract selectInternalSubtitle(index: number): number;
|
|
173
|
-
/**
|
|
174
|
-
* Stops pushing media streams to a CDN.
|
|
175
|
-
* Agora recommends that you use the server-side Media Push function. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times.After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
|
|
176
|
-
*
|
|
177
|
-
* @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
|
|
178
|
-
*
|
|
179
|
-
* @returns
|
|
180
|
-
* 0: Success.< 0: Failure.
|
|
181
|
-
*/
|
|
182
|
-
abstract setExternalSubtitle(url: string): number;
|
|
183
|
-
/**
|
|
184
|
-
* Gets current playback state.
|
|
185
|
-
*
|
|
186
|
-
* @returns
|
|
187
|
-
* The current playback state. See MediaPlayerState .
|
|
188
|
-
*/
|
|
189
|
-
abstract getState(): MediaPlayerState;
|
|
190
|
-
/**
|
|
191
|
-
* Sets whether to mute the media file.
|
|
192
|
-
*
|
|
193
|
-
* @param muted Whether to mute the media file:true: Mute the media file.false: (Default) Unmute the media file.
|
|
194
|
-
*
|
|
195
|
-
* @returns
|
|
196
|
-
* 0: Success.< 0: Failure.
|
|
197
|
-
*/
|
|
198
|
-
abstract mute(muted: boolean): number;
|
|
199
|
-
/**
|
|
200
|
-
* Reports whether the media resource is muted.
|
|
201
|
-
*
|
|
202
|
-
* @returns
|
|
203
|
-
* true: Reports whether the media resource is muted.false: Reports whether the media resource is muted.
|
|
204
|
-
*/
|
|
205
|
-
abstract getMute(): boolean;
|
|
206
|
-
/**
|
|
207
|
-
* Adjusts the local playback volume.
|
|
208
|
-
*
|
|
209
|
-
* @param volume The local playback volume, which ranges from 0 to 100:0: Mute.100: (Default) The original volume.
|
|
210
|
-
*
|
|
211
|
-
* @returns
|
|
212
|
-
* 0: Success.< 0: Failure.
|
|
213
|
-
*/
|
|
214
|
-
abstract adjustPlayoutVolume(volume: number): number;
|
|
215
|
-
/**
|
|
216
|
-
* Gets the local playback volume.
|
|
217
|
-
*
|
|
218
|
-
* @returns
|
|
219
|
-
* The local playback volume, which ranges from 0 to 100.0: Mute.100: (Default) The original volume.
|
|
220
|
-
*/
|
|
221
|
-
abstract getPlayoutVolume(): number;
|
|
222
|
-
/**
|
|
223
|
-
* Adjusts the volume of the media file for publishing.
|
|
224
|
-
* After connected to the Agora server, you can call this method to adjust the volume of the media file heard by the remote user.
|
|
225
|
-
*
|
|
226
|
-
* @param volume The volume, which ranges from 0 to 400:0: Mute.100: (Default) The original volume.400: Four times the original volume (amplifying the audio signals by four times).
|
|
227
|
-
*
|
|
228
|
-
* @returns
|
|
229
|
-
* 0: Success.< 0: Failure.
|
|
230
|
-
*/
|
|
231
|
-
abstract adjustPublishSignalVolume(volume: number): number;
|
|
232
|
-
/**
|
|
233
|
-
* Gets the volume of the media file for publishing.
|
|
234
|
-
*
|
|
235
|
-
* @returns
|
|
236
|
-
* The remote playback volume, if the method call succeeds.< 0: Failure.
|
|
237
|
-
*/
|
|
238
|
-
abstract getPublishSignalVolume(): number;
|
|
239
|
-
/**
|
|
240
|
-
* Destroys a video renderer object.
|
|
241
|
-
*
|
|
242
|
-
* @param view The HTMLElement object to be destroyed.
|
|
243
|
-
*/
|
|
244
|
-
abstract setView(view: any): number;
|
|
245
|
-
/**
|
|
246
|
-
* @ignore
|
|
247
|
-
*/
|
|
248
|
-
abstract setRenderMode(renderMode: RenderModeType): number;
|
|
249
|
-
/**
|
|
250
|
-
* Registers a media player observer.
|
|
251
|
-
*
|
|
252
|
-
* @param observer The player observer, listening for events during the playback. See IMediaPlayerSourceObserver .
|
|
253
|
-
*
|
|
254
|
-
* @returns
|
|
255
|
-
* 0: Success.< 0: Failure.
|
|
256
|
-
*/
|
|
257
|
-
abstract registerPlayerSourceObserver(observer: IMediaPlayerSourceObserver): number;
|
|
258
|
-
/**
|
|
259
|
-
* Releases a media player observer.
|
|
260
|
-
*
|
|
261
|
-
* @param observer The player observer, listening for events during the playback. See IMediaPlayerSourceObserver .
|
|
262
|
-
*
|
|
263
|
-
* @returns
|
|
264
|
-
* 0: Success.< 0: Failure.
|
|
265
|
-
*/
|
|
266
|
-
abstract unregisterPlayerSourceObserver(observer: IMediaPlayerSourceObserver): number;
|
|
267
|
-
/**
|
|
268
|
-
* @ignore
|
|
269
|
-
*/
|
|
270
|
-
abstract registerMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver, intervalInMS: number): number;
|
|
271
|
-
/**
|
|
272
|
-
* Unregisters the encoded audio frame observer.
|
|
273
|
-
*
|
|
274
|
-
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver .
|
|
275
|
-
*
|
|
276
|
-
* @returns
|
|
277
|
-
* 0: Success.< 0: Failure.
|
|
278
|
-
*/
|
|
279
|
-
abstract unregisterMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver): number;
|
|
280
|
-
/**
|
|
281
|
-
* Sets the channel mode of the current audio file.
|
|
282
|
-
* In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the KTV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.Call this method after calling open .This method only applies to stereo audio files.
|
|
283
|
-
*
|
|
284
|
-
* @param mode The channel mode. See AudioDualMonoMode .
|
|
285
|
-
*
|
|
286
|
-
* @returns
|
|
287
|
-
* 0: Success.< 0: Failure.
|
|
288
|
-
*/
|
|
289
|
-
abstract setAudioDualMonoMode(mode: AudioDualMonoMode): number;
|
|
290
|
-
/**
|
|
291
|
-
* @ignore
|
|
292
|
-
*/
|
|
293
|
-
abstract getPlayerSdkVersion(): string;
|
|
294
|
-
/**
|
|
295
|
-
* @ignore
|
|
296
|
-
*/
|
|
297
|
-
abstract getPlaySrc(): string;
|
|
298
|
-
/**
|
|
299
|
-
* @ignore
|
|
300
|
-
*/
|
|
301
|
-
abstract openWithAgoraCDNSrc(src: string, startPos: number): number;
|
|
302
|
-
/**
|
|
303
|
-
* @ignore
|
|
304
|
-
*/
|
|
305
|
-
abstract getAgoraCDNLineCount(): number;
|
|
306
|
-
/**
|
|
307
|
-
* @ignore
|
|
308
|
-
*/
|
|
309
|
-
abstract switchAgoraCDNLineByIndex(index: number): number;
|
|
310
|
-
/**
|
|
311
|
-
* @ignore
|
|
312
|
-
*/
|
|
313
|
-
abstract getCurrentAgoraCDNIndex(): number;
|
|
314
|
-
/**
|
|
315
|
-
* @ignore
|
|
316
|
-
*/
|
|
317
|
-
abstract enableAutoSwitchAgoraCDN(enable: boolean): number;
|
|
318
|
-
/**
|
|
319
|
-
* @ignore
|
|
320
|
-
*/
|
|
321
|
-
abstract renewAgoraCDNSrcToken(token: string, ts: number): number;
|
|
322
|
-
/**
|
|
323
|
-
* @ignore
|
|
324
|
-
*/
|
|
325
|
-
abstract switchAgoraCDNSrc(src: string, syncPts?: boolean): number;
|
|
326
|
-
/**
|
|
327
|
-
* Switches the media resource being played.
|
|
328
|
-
* You can call this method to switch the media resource to be played according to the current network status. For example:When the network is poor, the media resource to be played is switched to a media resource address with a lower bitrate.When the network is good, the media resource to be played is switched to a media resource address with a higher bitrate.After calling this method, if you receive the PlayerEventSwitchComplete event in the onPlayerEvent callback, the switch is successful; If you receive the PlayerEventSwitchError event in the onPlayerEvent callback, the switch fails.Ensure that you call this method after open .To ensure normal playback, pay attention to the following when calling this method:Do not call this method when playback is paused.Do not call the seek method during switching.Before switching the media resource, make sure that the playback position does not exceed the total duration of the media resource to be switched.
|
|
329
|
-
*
|
|
330
|
-
* @param src The URL of the media resource.
|
|
331
|
-
* @param syncPts Whether to synchronize the playback position (ms) before and after the switch:true: Synchronize the playback position before and after the switch.false: (Default) Do not synchronize the playback position before and after the switch.Make sure to set this parameter as false if you need to play live streams, or the switch fails. If you need to play on-demand streams, you can set the value of this parameter according to your scenarios.
|
|
332
|
-
*
|
|
333
|
-
* @returns
|
|
334
|
-
* 0: Success.< 0: Failure.
|
|
335
|
-
*/
|
|
336
|
-
abstract switchSrc(src: string, syncPts?: boolean): number;
|
|
337
|
-
/**
|
|
338
|
-
* Preloads a media resource.
|
|
339
|
-
* You can call this method to preload a media resource into the playlist. If you need to preload multiple media resources, you can call this method multiple times.After calling this method, if you receive the PlayerPreloadEventComplete event in the onPreloadEvent callback, the preload is successful; If you receive the PlayerPreloadEventError event in the onPreloadEvent callback, the preload fails.If the preload is successful and you want to play the media resource, call playPreloadedSrc ; if you want to clear the playlist, call stop .Agora does not support preloading duplicate media resources to the playlist. However, you can preload the media resources that are being played to the playlist again.
|
|
340
|
-
*
|
|
341
|
-
* @param src The URL of the media resource.
|
|
342
|
-
* @param startPos The starting position (ms) for playing after the media resource is preloaded to the playlist. When preloading a live stream, set this parameter to 0.
|
|
343
|
-
*
|
|
344
|
-
* @returns
|
|
345
|
-
* 0: Success.< 0: Failure.
|
|
346
|
-
*/
|
|
347
|
-
abstract preloadSrc(src: string, startPos: number): number;
|
|
348
|
-
/**
|
|
349
|
-
* Plays preloaded media resources.
|
|
350
|
-
* After calling the preloadSrc method to preload the media resource into the playlist, you can call this method to play the preloaded media resource. After calling this method, if you receive the onPlayerSourceStateChanged callback which reports the PlayerStatePlaying state, the playback is successful.If you want to change the preloaded media resource to be played, you can call this method again and specify the URL of the new media resource that you want to preload. If you want to replay the media resource, you need to call preloadSrc to preload the media resource to the playlist again before playing. If you want to clear the playlist, call the stop method.If you call this method when playback is paused, this method does not take effect until playback is resumed.
|
|
351
|
-
*
|
|
352
|
-
* @param src The URL of the media resource in the playlist must be consistent with the src set by the preloadSrc method; otherwise, the media resource cannot be played.
|
|
353
|
-
*
|
|
354
|
-
* @returns
|
|
355
|
-
* 0: Success.< 0: Failure.
|
|
356
|
-
*/
|
|
357
|
-
abstract playPreloadedSrc(src: string): number;
|
|
358
|
-
/**
|
|
359
|
-
* Unloads media resources that are preloaded.
|
|
360
|
-
* This method cannot release the media resource being played.
|
|
361
|
-
*
|
|
362
|
-
* @param src The URL of the media resource.
|
|
363
|
-
*
|
|
364
|
-
* @returns
|
|
365
|
-
* 0: Success.< 0: Failure.
|
|
366
|
-
*/
|
|
367
|
-
abstract unloadSrc(src: string): number;
|
|
368
|
-
/**
|
|
369
|
-
* Enables or disables the spatial audio effect for the media player.
|
|
370
|
-
* After successfully setting the spatial audio effect parameters of the media player, the SDK enables the spatial audio effect for the media player, and the local user can hear the media resources with a sense of space.If you need to disable the spatial audio effect for the media player, set the params parameter to null.
|
|
371
|
-
*
|
|
372
|
-
* @returns
|
|
373
|
-
* 0: Success.< 0: Failure.
|
|
374
|
-
*/
|
|
375
|
-
abstract setSpatialAudioParams(params: SpatialAudioParams): number;
|
|
376
|
-
/**
|
|
377
|
-
* @ignore
|
|
378
|
-
*/
|
|
379
|
-
abstract setSoundPositionParams(pan: number, gain: number): number;
|
|
380
|
-
/**
|
|
381
|
-
* Registers an audio frame observer object.
|
|
382
|
-
*
|
|
383
|
-
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType .
|
|
384
|
-
*/
|
|
385
|
-
abstract registerAudioFrameObserver(observer: IAudioPcmFrameSink, mode?: RawAudioFrameOpModeType): number;
|
|
386
|
-
/**
|
|
387
|
-
* Unregisters an audio observer.
|
|
388
|
-
*
|
|
389
|
-
* @param observer The audio observer. See IMediaPlayerAudioFrameObserver .
|
|
390
|
-
*
|
|
391
|
-
* @returns
|
|
392
|
-
* 0: Success.< 0: Failure.
|
|
393
|
-
*/
|
|
394
|
-
abstract unregisterAudioFrameObserver(observer: IAudioPcmFrameSink): number;
|
|
395
|
-
/**
|
|
396
|
-
* Registers a video frame observer object.
|
|
397
|
-
* You need to implement the IMediaPlayerVideoFrameObserver class in this method and register callbacks according to your scenarios. After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received.
|
|
398
|
-
*
|
|
399
|
-
* @param observer The video observer, reporting the reception of each video frame. See IMediaPlayerVideoFrameObserver .
|
|
400
|
-
*
|
|
401
|
-
* @returns
|
|
402
|
-
* 0: Success.< 0: Failure.
|
|
403
|
-
*/
|
|
404
|
-
abstract registerVideoFrameObserver(observer: IMediaPlayerVideoFrameObserver): number;
|
|
405
|
-
/**
|
|
406
|
-
* Unregisters the video frame observer.
|
|
407
|
-
*
|
|
408
|
-
* @param observer The video observer, reporting the reception of each video frame. See IMediaPlayerVideoFrameObserver .
|
|
409
|
-
*
|
|
410
|
-
* @returns
|
|
411
|
-
* 0: Success.< 0: Failure.
|
|
412
|
-
*/
|
|
413
|
-
abstract unregisterVideoFrameObserver(observer: IMediaPlayerVideoFrameObserver): number;
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* This class provides methods to manage cached media files.
|
|
417
|
-
*/
|
|
418
|
-
export declare abstract class IMediaPlayerCacheManager {
|
|
419
|
-
/**
|
|
420
|
-
* Deletes all cached media files in the media player.
|
|
421
|
-
* The cached media file currently being played will not be deleted.
|
|
422
|
-
*
|
|
423
|
-
* @returns
|
|
424
|
-
* 0: Success.< 0: Failure. See MediaPlayerError .
|
|
425
|
-
*/
|
|
426
|
-
abstract removeAllCaches(): number;
|
|
427
|
-
/**
|
|
428
|
-
* Deletes a cached media file that is the least recently used.
|
|
429
|
-
* 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.
|
|
430
|
-
*
|
|
431
|
-
* @returns
|
|
432
|
-
* 0: Success.
|
|
433
|
-
* < 0: Failure. See MediaPlayerError .
|
|
434
|
-
*/
|
|
435
|
-
abstract removeOldCache(): number;
|
|
436
|
-
/**
|
|
437
|
-
* Deletes a cached media file.
|
|
438
|
-
* The cached media file currently being played will not be deleted.
|
|
439
|
-
*
|
|
440
|
-
* @param uri The URI (Uniform Resource Identifier) of the media file to be deleted.
|
|
441
|
-
*
|
|
442
|
-
* @returns
|
|
443
|
-
* 0: Success.
|
|
444
|
-
* < 0: Failure. See MediaPlayerError .
|
|
445
|
-
*/
|
|
446
|
-
abstract removeCacheByUri(uri: string): number;
|
|
447
|
-
/**
|
|
448
|
-
* Sets the storage path for the media files that you want to cache.
|
|
449
|
-
* Make sure IRtcEngine is initialized before you call this method.
|
|
450
|
-
*
|
|
451
|
-
* @param path The absolute path of the media files to be cached. Ensure that the directory for the media files exists and is writable.
|
|
452
|
-
*
|
|
453
|
-
* @returns
|
|
454
|
-
* 0: Success.
|
|
455
|
-
* < 0: Failure. See MediaPlayerError .
|
|
456
|
-
*/
|
|
457
|
-
abstract setCacheDir(path: string): number;
|
|
458
|
-
/**
|
|
459
|
-
* Sets the maximum number of media files that can be cached.
|
|
460
|
-
*
|
|
461
|
-
* @param count The maximum number of media files that can be cached. The default value is 1,000.
|
|
462
|
-
*
|
|
463
|
-
* @returns
|
|
464
|
-
* 0: Success.< 0: Failure. See MediaPlayerError .
|
|
465
|
-
*/
|
|
466
|
-
abstract setMaxCacheFileCount(count: number): number;
|
|
467
|
-
/**
|
|
468
|
-
* Sets the maximum size of the aggregate storage space for cached media files.
|
|
469
|
-
*
|
|
470
|
-
* @param cacheSize The maximum size (bytes) of the aggregate storage space for cached media files. The default value is 1 GB.
|
|
471
|
-
*
|
|
472
|
-
* @returns
|
|
473
|
-
* 0: Success.< 0: Failure. See MediaPlayerError .
|
|
474
|
-
*/
|
|
475
|
-
abstract setMaxCacheFileSize(cacheSize: number): number;
|
|
476
|
-
/**
|
|
477
|
-
* Sets whether to delete cached media files automatically.
|
|
478
|
-
* If you enable this function to remove cached media files automatically, when the cached media files exceed either the number or size limit you set, the SDK automatically deletes the least recently used cache file.
|
|
479
|
-
*
|
|
480
|
-
* @param enable Whether to enable the SDK to delete cached media files automatically:true: Delete cached media files automatically.false: (Default) Do not delete cached media files automatically.
|
|
481
|
-
*
|
|
482
|
-
* @returns
|
|
483
|
-
* 0: Success.
|
|
484
|
-
* < 0: Failure. See MediaPlayerError .
|
|
485
|
-
*/
|
|
486
|
-
abstract enableAutoRemoveCache(enable: boolean): number;
|
|
487
|
-
/**
|
|
488
|
-
* Gets the storage path of the cached media files.
|
|
489
|
-
* If you have not called the setCacheDir method to set the storage path for the media files to be cached before calling this method, you get the default storage path used by the SDK.
|
|
490
|
-
*
|
|
491
|
-
* @param length An input parameter; the maximum length of the cache file storage path string.
|
|
492
|
-
*
|
|
493
|
-
* @returns
|
|
494
|
-
* The call succeeds, and the SDK returns the storage path of the cached media files.< 0: Failure. See MediaPlayerError .
|
|
495
|
-
*/
|
|
496
|
-
abstract getCacheDir(length: number): string;
|
|
497
|
-
/**
|
|
498
|
-
* Gets the maximum number of media files that can be cached.
|
|
499
|
-
* By default, the maximum number of media files that can be cached is 1,000.
|
|
500
|
-
*
|
|
501
|
-
* @returns
|
|
502
|
-
* > 0: The call succeeds and returns the maximum number of media files that can be cached.< 0: Failure. See MediaPlayerError .
|
|
503
|
-
*/
|
|
504
|
-
abstract getMaxCacheFileCount(): number;
|
|
505
|
-
/**
|
|
506
|
-
* Gets the maximum size of the aggregate storage space for cached media files.
|
|
507
|
-
* By default, the maximum size of the aggregate storage space for cached media files is 1 GB. You can call the setMaxCacheFileSize method to set the limit according to your scenarios.
|
|
508
|
-
*
|
|
509
|
-
* @returns
|
|
510
|
-
* > 0: The call succeeds and returns the maximum size (in bytes) of the aggregate storage space for cached media files.< 0: Failure. See MediaPlayerError .
|
|
511
|
-
*/
|
|
512
|
-
abstract getMaxCacheFileSize(): number;
|
|
513
|
-
/**
|
|
514
|
-
* Gets the number of media files that are cached.
|
|
515
|
-
*
|
|
516
|
-
* @returns
|
|
517
|
-
* ≥ 0: The call succeeds and returns the number of media files that are cached.< 0: Failure. See MediaPlayerError .
|
|
518
|
-
*/
|
|
519
|
-
abstract getCacheFileCount(): number;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* The video frame observer for the media player.
|
|
523
|
-
*/
|
|
524
|
-
export interface IMediaPlayerVideoFrameObserver {
|
|
525
|
-
/**
|
|
526
|
-
* Occurs each time the player receives a video frame.
|
|
527
|
-
* After registering the video frame observer, the callback occurs every time the player receives a video frame, reporting the detailed information of the video frame.
|
|
528
|
-
*
|
|
529
|
-
* @param frame Video frame information. See VideoFrame .
|
|
530
|
-
*/
|
|
531
|
-
onFrame?(frame: VideoFrame): void;
|
|
532
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import './extension/IAgoraMediaPlayerSourceExtension';
|
|
2
|
-
import { MediaPlayerError, MediaPlayerEvent, MediaPlayerState, PlayerPreloadEvent, PlayerUpdatedInfo, SrcInfo } from './AgoraMediaPlayerTypes';
|
|
3
|
-
/**
|
|
4
|
-
* Provides callbacks for media players.
|
|
5
|
-
*/
|
|
6
|
-
export interface IMediaPlayerSourceObserver {
|
|
7
|
-
/**
|
|
8
|
-
* Reports the playback state change.
|
|
9
|
-
* When the state of the media player changes, the SDK triggers this callback to report the current playback state.
|
|
10
|
-
*
|
|
11
|
-
* @param state The playback state, see MediaPlayerState .
|
|
12
|
-
* @param ec The error code. See MediaPlayerError .
|
|
13
|
-
*/
|
|
14
|
-
onPlayerSourceStateChanged?(state: MediaPlayerState, ec: MediaPlayerError): void;
|
|
15
|
-
/**
|
|
16
|
-
* Reports current playback progress.
|
|
17
|
-
* When playing media files, the SDK triggers this callback every one second to report current playback progress.
|
|
18
|
-
*
|
|
19
|
-
* @param position The playback position (ms) of media files.
|
|
20
|
-
*/
|
|
21
|
-
onPositionChanged?(positionMs: number): void;
|
|
22
|
-
/**
|
|
23
|
-
* Reports the playback event.
|
|
24
|
-
* After calling the seek method, the SDK triggers the callback to report the results of the seek operation.
|
|
25
|
-
*
|
|
26
|
-
* @param eventCode The playback event. See MediaPlayerEvent .
|
|
27
|
-
* @param elapsedTime The time (ms) when the event occurs.
|
|
28
|
-
* @param message Information about the event.
|
|
29
|
-
*/
|
|
30
|
-
onPlayerEvent?(eventCode: MediaPlayerEvent, elapsedTime: number, message: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Occurs when the media metadata is received.
|
|
33
|
-
* The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.
|
|
34
|
-
*
|
|
35
|
-
* @param data The detailed data of the media metadata.
|
|
36
|
-
* @param length The data length (bytes).
|
|
37
|
-
*/
|
|
38
|
-
onMetaData?(data: Uint8Array, length: number): void;
|
|
39
|
-
/**
|
|
40
|
-
* Reports the playback duration that the buffered data can support.
|
|
41
|
-
* When playing online media resources, the SDK triggers this callback every two seconds to report the playback duration that the currently buffered data can support.When the playback duration supported by the buffered data is less than the threshold (0 by default), the SDK returns PlayerEventBufferLow.When the playback duration supported by the buffered data is greater than the threshold (0 by default), the SDK returns PlayerEventBufferRecover.
|
|
42
|
-
*
|
|
43
|
-
* @param playCachedBuffer The playback duration (ms) that the buffered data can support.
|
|
44
|
-
*/
|
|
45
|
-
onPlayBufferUpdated?(playCachedBuffer: number): void;
|
|
46
|
-
/**
|
|
47
|
-
* Reports the events of preloaded media resources.
|
|
48
|
-
*
|
|
49
|
-
* @param src The URL of the media resource.
|
|
50
|
-
* @param event Events that occur when media resources are preloaded. See PlayerPreloadEvent .
|
|
51
|
-
*/
|
|
52
|
-
onPreloadEvent?(src: string, event: PlayerPreloadEvent): void;
|
|
53
|
-
/**
|
|
54
|
-
* @ignore
|
|
55
|
-
*/
|
|
56
|
-
onCompleted?(): void;
|
|
57
|
-
/**
|
|
58
|
-
* @ignore
|
|
59
|
-
*/
|
|
60
|
-
onAgoraCDNTokenWillExpire?(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Occurs when the video bitrate of the media resource changes.
|
|
63
|
-
*
|
|
64
|
-
* @param from Information about the video bitrate of the media resource being played. See SrcInfo .
|
|
65
|
-
* @param to Information about the changed video bitrate of media resource being played. See SrcInfo .
|
|
66
|
-
*/
|
|
67
|
-
onPlayerSrcInfoChanged?(from: SrcInfo, to: SrcInfo): void;
|
|
68
|
-
/**
|
|
69
|
-
* Occurs when information related to the media player changes.
|
|
70
|
-
* When the information about the media player changes, the SDK triggers this callback. You can use this callback for troubleshooting.
|
|
71
|
-
*
|
|
72
|
-
* @param info Information related to the media player. See PlayerUpdatedInfo .
|
|
73
|
-
*/
|
|
74
|
-
onPlayerInfoUpdated?(info: PlayerUpdatedInfo): void;
|
|
75
|
-
/**
|
|
76
|
-
* Reports the volume of the media player.
|
|
77
|
-
* The SDK triggers this callback every 200 milliseconds to report the current volume of the media player.
|
|
78
|
-
*
|
|
79
|
-
* @param volume The volume of the media player. The value ranges from 0 to 255.
|
|
80
|
-
*/
|
|
81
|
-
onAudioVolumeIndication?(volume: number): void;
|
|
82
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import './extension/IAgoraMediaRecorderExtension';
|
|
2
|
-
import { IMediaRecorderObserver, MediaRecorderConfiguration } from './AgoraMediaBase';
|
|
3
|
-
/**
|
|
4
|
-
* Used for recording audio and video on the client.
|
|
5
|
-
* IMediaRecorder can record the following:
|
|
6
|
-
* The audio captured by the local microphone and encoded in AAC format.The video captured by the local camera and encoded by the SDK.
|
|
7
|
-
*/
|
|
8
|
-
export declare abstract class IMediaRecorder {
|
|
9
|
-
/**
|
|
10
|
-
* Registers one IMediaRecorderObserver object.
|
|
11
|
-
* Make sure that IRtcEngine is initialized before you call this method.
|
|
12
|
-
*
|
|
13
|
-
* @param connection The connection information. See RtcConnection .
|
|
14
|
-
* @param callback The callbacks for recording local audio and video streams. See IMediaRecorderObserver .
|
|
15
|
-
*
|
|
16
|
-
* @returns
|
|
17
|
-
* 0: Success.< 0: Failure.
|
|
18
|
-
*/
|
|
19
|
-
abstract setMediaRecorderObserver(callback: IMediaRecorderObserver): number;
|
|
20
|
-
/**
|
|
21
|
-
* @ignore
|
|
22
|
-
*/
|
|
23
|
-
abstract startRecording(config: MediaRecorderConfiguration): number;
|
|
24
|
-
/**
|
|
25
|
-
* @ignore
|
|
26
|
-
*/
|
|
27
|
-
abstract stopRecording(): number;
|
|
28
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import './extension/IAgoraMediaStreamingSourceExtension';
|
|
2
|
-
export declare enum StreamingSrcErr {
|
|
3
|
-
StreamingSrcErrNone = 0,
|
|
4
|
-
StreamingSrcErrUnknown = 1,
|
|
5
|
-
StreamingSrcErrInvalidParam = 2,
|
|
6
|
-
StreamingSrcErrBadState = 3,
|
|
7
|
-
StreamingSrcErrNoMem = 4,
|
|
8
|
-
StreamingSrcErrBufferOverflow = 5,
|
|
9
|
-
StreamingSrcErrBufferUnderflow = 6,
|
|
10
|
-
StreamingSrcErrNotFound = 7,
|
|
11
|
-
StreamingSrcErrTimeout = 8,
|
|
12
|
-
StreamingSrcErrExpired = 9,
|
|
13
|
-
StreamingSrcErrUnsupported = 10,
|
|
14
|
-
StreamingSrcErrNotExist = 11,
|
|
15
|
-
StreamingSrcErrExist = 12,
|
|
16
|
-
StreamingSrcErrOpen = 13,
|
|
17
|
-
StreamingSrcErrClose = 14,
|
|
18
|
-
StreamingSrcErrRead = 15,
|
|
19
|
-
StreamingSrcErrWrite = 16,
|
|
20
|
-
StreamingSrcErrSeek = 17,
|
|
21
|
-
StreamingSrcErrEof = 18,
|
|
22
|
-
StreamingSrcErrCodecopen = 19,
|
|
23
|
-
StreamingSrcErrCodecclose = 20,
|
|
24
|
-
StreamingSrcErrCodecproc = 21
|
|
25
|
-
}
|
|
26
|
-
export declare enum StreamingSrcState {
|
|
27
|
-
StreamingSrcStateClosed = 0,
|
|
28
|
-
StreamingSrcStateOpening = 1,
|
|
29
|
-
StreamingSrcStateIdle = 2,
|
|
30
|
-
StreamingSrcStatePlaying = 3,
|
|
31
|
-
StreamingSrcStateSeeking = 4,
|
|
32
|
-
StreamingSrcStateEof = 5,
|
|
33
|
-
StreamingSrcStateError = 6
|
|
34
|
-
}
|
|
35
|
-
export declare class InputSeiData {
|
|
36
|
-
type?: number;
|
|
37
|
-
timestamp?: number;
|
|
38
|
-
frame_index?: number;
|
|
39
|
-
private_data?: Uint8Array;
|
|
40
|
-
data_size?: number;
|
|
41
|
-
}
|