agora-electron-sdk 4.2.6 → 4.3.0-dev.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/CHANGELOG.md +20 -0
- package/js/Private/AgoraBase.js +139 -174
- package/js/Private/AgoraMediaBase.js +49 -20
- package/js/Private/AgoraMediaPlayerTypes.js +32 -23
- package/js/Private/IAgoraH265Transcoder.js +39 -0
- package/js/Private/IAgoraMediaStreamingSource.js +32 -32
- package/js/Private/IAgoraMusicContentCenter.js +19 -19
- package/js/Private/IAgoraRhythmPlayer.js +9 -9
- package/js/Private/IAgoraRtcEngine.js +12 -12
- package/js/Private/IAgoraSpatialAudio.js +3 -31
- package/js/Private/extension/IAgoraH265TranscoderExtension.js +2 -0
- package/js/Private/impl/AgoraMediaBaseImpl.js +26 -2
- package/js/Private/impl/IAgoraH265TranscoderImpl.js +119 -0
- package/js/Private/impl/IAgoraMediaEngineImpl.js +13 -13
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +92 -74
- package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +12 -2
- package/js/Private/impl/IAgoraMediaRecorderImpl.js +2 -2
- package/js/Private/impl/IAgoraMusicContentCenterImpl.js +20 -20
- package/js/Private/impl/IAgoraRtcEngineExImpl.js +66 -84
- package/js/Private/impl/IAgoraRtcEngineImpl.js +456 -440
- package/js/Private/impl/IAgoraSpatialAudioImpl.js +157 -181
- package/js/Private/impl/IAudioDeviceManagerImpl.js +22 -22
- package/js/Private/internal/AgoraH265TranscoderInternal.js +86 -0
- package/js/Private/internal/AgoraMediaBaseInternal.js +34 -0
- package/js/Private/internal/IrisApiEngine.js +35 -20
- package/js/Private/internal/LocalSpatialAudioEngineInternal.js +0 -39
- package/js/Private/internal/MediaPlayerInternal.js +22 -21
- package/js/Private/internal/MusicContentCenterInternal.js +1 -4
- package/js/Private/internal/RtcEngineExInternal.js +101 -134
- package/js/Private/ti/AgoraMediaBase-ti.js +1 -1
- package/js/Private/ti/IAgoraH265Transcoder-ti.js +40 -0
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +4 -2
- package/js/Private/ti/IAgoraMusicContentCenter-ti.js +5 -5
- package/js/Private/ti/IAgoraRtcEngine-ti.js +12 -11
- package/js/Renderer/AgoraView.js +28 -14
- package/js/Renderer/IRenderer.js +65 -17
- package/js/Renderer/IRendererManager.js +230 -0
- package/js/Renderer/RendererCache.js +170 -0
- package/js/Renderer/RendererManager.js +49 -460
- package/js/Renderer/WebGLRenderer/index.js +82 -234
- package/js/Renderer/YUVCanvasRenderer/index.js +27 -147
- package/js/Types.js +6 -6
- package/js/Utils.js +37 -88
- package/package.json +4 -3
- package/scripts/clean.js +12 -0
- package/scripts/synclib.js +8 -2
- package/ts/Private/AgoraBase.ts +225 -201
- package/ts/Private/AgoraMediaBase.ts +63 -25
- package/ts/Private/AgoraMediaPlayerTypes.ts +67 -24
- package/ts/Private/IAgoraH265Transcoder.ts +73 -0
- package/ts/Private/IAgoraLog.ts +1 -0
- package/ts/Private/IAgoraMediaEngine.ts +12 -7
- package/ts/Private/IAgoraMediaPlayer.ts +47 -21
- package/ts/Private/IAgoraMediaPlayerSource.ts +27 -6
- package/ts/Private/IAgoraMediaStreamingSource.ts +38 -37
- package/ts/Private/IAgoraMusicContentCenter.ts +20 -20
- package/ts/Private/IAgoraRhythmPlayer.ts +7 -6
- package/ts/Private/IAgoraRtcEngine.ts +407 -364
- package/ts/Private/IAgoraRtcEngineEx.ts +25 -61
- package/ts/Private/IAgoraSpatialAudio.ts +80 -191
- package/ts/Private/IAudioDeviceManager.ts +27 -14
- package/ts/Private/extension/IAgoraH265TranscoderExtension.ts +39 -0
- package/ts/Private/impl/AgoraMediaBaseImpl.ts +25 -1
- package/ts/Private/impl/IAgoraH265TranscoderImpl.ts +152 -0
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +13 -13
- package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +110 -81
- package/ts/Private/impl/IAgoraMediaPlayerSourceImpl.ts +17 -2
- package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +2 -2
- package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +21 -21
- package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +71 -106
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +589 -572
- package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +211 -218
- package/ts/Private/impl/IAudioDeviceManagerImpl.ts +22 -22
- package/ts/Private/internal/AgoraH265TranscoderInternal.ts +97 -0
- package/ts/Private/internal/AgoraMediaBaseInternal.ts +15 -0
- package/ts/Private/internal/IrisApiEngine.ts +42 -27
- package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +1 -86
- package/ts/Private/internal/MediaPlayerInternal.ts +20 -29
- package/ts/Private/internal/MusicContentCenterInternal.ts +1 -5
- package/ts/Private/internal/RtcEngineExInternal.ts +91 -204
- package/ts/Private/ti/AgoraMediaBase-ti.ts +1 -1
- package/ts/Private/ti/IAgoraH265Transcoder-ti.ts +16 -0
- package/ts/Private/ti/IAgoraMediaPlayerSource-ti.ts +4 -2
- package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +5 -5
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +12 -11
- package/ts/Renderer/AgoraView.ts +29 -19
- package/ts/Renderer/IRenderer.ts +71 -22
- package/ts/Renderer/IRendererManager.ts +273 -19
- package/ts/Renderer/RendererCache.ts +167 -0
- package/ts/Renderer/RendererManager.ts +62 -607
- package/ts/Renderer/WebGLRenderer/index.ts +117 -295
- package/ts/Renderer/YUVCanvasRenderer/index.ts +45 -198
- package/ts/Types.ts +17 -194
- package/ts/Utils.ts +36 -100
- package/types/Private/AgoraBase.d.ts +219 -200
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +63 -27
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaPlayerTypes.d.ts +65 -24
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
- package/types/Private/IAgoraH265Transcoder.d.ts +28 -0
- package/types/Private/IAgoraH265Transcoder.d.ts.map +1 -0
- package/types/Private/IAgoraLog.d.ts.map +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +11 -6
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +42 -20
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts +23 -6
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
- package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -1
- package/types/Private/IAgoraMusicContentCenter.d.ts +19 -19
- package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -1
- package/types/Private/IAgoraRhythmPlayer.d.ts +6 -6
- package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +329 -293
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +21 -53
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAgoraSpatialAudio.d.ts +56 -167
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +27 -14
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
- package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts +24 -0
- package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts.map +1 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts +5 -1
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts +15 -0
- package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +6 -4
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +2 -4
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +30 -25
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +20 -22
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -1
- package/types/Private/internal/AgoraH265TranscoderInternal.d.ts +14 -0
- package/types/Private/internal/AgoraH265TranscoderInternal.d.ts.map +1 -0
- package/types/Private/internal/AgoraMediaBaseInternal.d.ts +8 -0
- package/types/Private/internal/AgoraMediaBaseInternal.d.ts.map +1 -0
- package/types/Private/internal/IrisApiEngine.d.ts +5 -2
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +0 -15
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -1
- package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts +0 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts +7 -13
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts +8 -0
- package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -1
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -1
- package/types/Renderer/AgoraView.d.ts +4 -4
- package/types/Renderer/AgoraView.d.ts.map +1 -1
- package/types/Renderer/IRenderer.d.ts +11 -9
- package/types/Renderer/IRenderer.d.ts.map +1 -1
- package/types/Renderer/IRendererManager.d.ts +50 -12
- package/types/Renderer/IRendererManager.d.ts.map +1 -1
- package/types/Renderer/RendererCache.d.ts +36 -0
- package/types/Renderer/RendererCache.d.ts.map +1 -0
- package/types/Renderer/RendererManager.d.ts +13 -139
- package/types/Renderer/RendererManager.d.ts.map +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts +3 -18
- package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
- package/types/Renderer/YUVCanvasRenderer/index.d.ts +4 -10
- package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -1
- package/types/Types.d.ts +11 -187
- package/types/Types.d.ts.map +1 -1
- package/types/Utils.d.ts +3 -20
- package/types/Utils.d.ts.map +1 -1
|
@@ -134,7 +134,7 @@ export abstract class IMediaPlayer {
|
|
|
134
134
|
*
|
|
135
135
|
* @returns
|
|
136
136
|
* Returns the current playback progress (ms) if the call succeeds.
|
|
137
|
-
* < 0: Failure. See
|
|
137
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
138
138
|
*/
|
|
139
139
|
abstract getPlayPosition(): number;
|
|
140
140
|
|
|
@@ -145,7 +145,7 @@ export abstract class IMediaPlayer {
|
|
|
145
145
|
*
|
|
146
146
|
* @returns
|
|
147
147
|
* The number of the media streams in the media resource if the method call succeeds.
|
|
148
|
-
* < 0: Failure. See
|
|
148
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
149
149
|
*/
|
|
150
150
|
abstract getStreamCount(): number;
|
|
151
151
|
|
|
@@ -154,11 +154,11 @@ export abstract class IMediaPlayer {
|
|
|
154
154
|
*
|
|
155
155
|
* Call this method after calling getStreamCount.
|
|
156
156
|
*
|
|
157
|
-
* @param index The index of the media stream.
|
|
157
|
+
* @param index The index of the media stream. This parameter must be less than the return value of getStreamCount.
|
|
158
158
|
*
|
|
159
159
|
* @returns
|
|
160
160
|
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo.
|
|
161
|
-
* If the call fails, returns
|
|
161
|
+
* If the call fails, returns null.
|
|
162
162
|
*/
|
|
163
163
|
abstract getStreamInfo(index: number): PlayerStreamInfo;
|
|
164
164
|
|
|
@@ -207,12 +207,10 @@ export abstract class IMediaPlayer {
|
|
|
207
207
|
/**
|
|
208
208
|
* @ignore
|
|
209
209
|
*/
|
|
210
|
-
abstract
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*/
|
|
215
|
-
abstract setPlayerOptionInString(key: string, value: string): number;
|
|
210
|
+
abstract selectMultiAudioTrack(
|
|
211
|
+
playoutTrackIndex: number,
|
|
212
|
+
publishTrackIndex: number
|
|
213
|
+
): number;
|
|
216
214
|
|
|
217
215
|
/**
|
|
218
216
|
* @ignore
|
|
@@ -558,6 +556,34 @@ export abstract class IMediaPlayer {
|
|
|
558
556
|
* @ignore
|
|
559
557
|
*/
|
|
560
558
|
abstract setSoundPositionParams(pan: number, gain: number): number;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Set media player options for providing technical previews or special customization features.
|
|
562
|
+
*
|
|
563
|
+
* The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInString is that the value parameter of this method is of type Int, while the value of setPlayerOptionInString is of type String. These two methods cannot be used together. Ensure that you call this method before open or openWithMediaSource.
|
|
564
|
+
*
|
|
565
|
+
* @param key The key of the option.
|
|
566
|
+
* @param value The value of the key.
|
|
567
|
+
*
|
|
568
|
+
* @returns
|
|
569
|
+
* 0: Success.
|
|
570
|
+
* < 0: Failure.
|
|
571
|
+
*/
|
|
572
|
+
abstract setPlayerOptionInInt(key: string, value: number): number;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Set media player options for providing technical previews or special customization features.
|
|
576
|
+
*
|
|
577
|
+
* Ensure that you call this method before open or openWithMediaSource. The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInInt is that the value parameter of this method is of type String, while the value of setPlayerOptionInInt is of type String. These two methods cannot be used together.
|
|
578
|
+
*
|
|
579
|
+
* @param key The key of the option.
|
|
580
|
+
* @param value The value of the key.
|
|
581
|
+
*
|
|
582
|
+
* @returns
|
|
583
|
+
* 0: Success.
|
|
584
|
+
* < 0: Failure.
|
|
585
|
+
*/
|
|
586
|
+
abstract setPlayerOptionInString(key: string, value: string): number;
|
|
561
587
|
}
|
|
562
588
|
|
|
563
589
|
/**
|
|
@@ -571,7 +597,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
571
597
|
*
|
|
572
598
|
* @returns
|
|
573
599
|
* 0: Success.
|
|
574
|
-
* < 0: Failure. See
|
|
600
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
575
601
|
*/
|
|
576
602
|
abstract removeAllCaches(): number;
|
|
577
603
|
|
|
@@ -582,7 +608,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
582
608
|
*
|
|
583
609
|
* @returns
|
|
584
610
|
* 0: Success.
|
|
585
|
-
* < 0: Failure. See
|
|
611
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
586
612
|
*/
|
|
587
613
|
abstract removeOldCache(): number;
|
|
588
614
|
|
|
@@ -595,7 +621,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
595
621
|
*
|
|
596
622
|
* @returns
|
|
597
623
|
* 0: Success.
|
|
598
|
-
* < 0: Failure. See
|
|
624
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
599
625
|
*/
|
|
600
626
|
abstract removeCacheByUri(uri: string): number;
|
|
601
627
|
|
|
@@ -608,7 +634,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
608
634
|
*
|
|
609
635
|
* @returns
|
|
610
636
|
* 0: Success.
|
|
611
|
-
* < 0: Failure. See
|
|
637
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
612
638
|
*/
|
|
613
639
|
abstract setCacheDir(path: string): number;
|
|
614
640
|
|
|
@@ -619,7 +645,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
619
645
|
*
|
|
620
646
|
* @returns
|
|
621
647
|
* 0: Success.
|
|
622
|
-
* < 0: Failure. See
|
|
648
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
623
649
|
*/
|
|
624
650
|
abstract setMaxCacheFileCount(count: number): number;
|
|
625
651
|
|
|
@@ -630,7 +656,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
630
656
|
*
|
|
631
657
|
* @returns
|
|
632
658
|
* 0: Success.
|
|
633
|
-
* < 0: Failure. See
|
|
659
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
634
660
|
*/
|
|
635
661
|
abstract setMaxCacheFileSize(cacheSize: number): number;
|
|
636
662
|
|
|
@@ -643,7 +669,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
643
669
|
*
|
|
644
670
|
* @returns
|
|
645
671
|
* 0: Success.
|
|
646
|
-
* < 0: Failure. See
|
|
672
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
647
673
|
*/
|
|
648
674
|
abstract enableAutoRemoveCache(enable: boolean): number;
|
|
649
675
|
|
|
@@ -656,7 +682,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
656
682
|
*
|
|
657
683
|
* @returns
|
|
658
684
|
* The call succeeds, and the SDK returns the storage path of the cached media files.
|
|
659
|
-
* < 0: Failure. See
|
|
685
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
660
686
|
*/
|
|
661
687
|
abstract getCacheDir(length: number): string;
|
|
662
688
|
|
|
@@ -667,7 +693,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
667
693
|
*
|
|
668
694
|
* @returns
|
|
669
695
|
* > 0: The call succeeds and returns the maximum number of media files that can be cached.
|
|
670
|
-
* < 0: Failure. See
|
|
696
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
671
697
|
*/
|
|
672
698
|
abstract getMaxCacheFileCount(): number;
|
|
673
699
|
|
|
@@ -678,7 +704,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
678
704
|
*
|
|
679
705
|
* @returns
|
|
680
706
|
* > 0: The call succeeds and returns the maximum size (in bytes) of the aggregate storage space for cached media files.
|
|
681
|
-
* < 0: Failure. See
|
|
707
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
682
708
|
*/
|
|
683
709
|
abstract getMaxCacheFileSize(): number;
|
|
684
710
|
|
|
@@ -687,7 +713,7 @@ export abstract class IMediaPlayerCacheManager {
|
|
|
687
713
|
*
|
|
688
714
|
* @returns
|
|
689
715
|
* ≥ 0: The call succeeds and returns the number of media files that are cached.
|
|
690
|
-
* < 0: Failure. See
|
|
716
|
+
* < 0: Failure. See MediaPlayerReason.
|
|
691
717
|
*/
|
|
692
718
|
abstract getCacheFileCount(): number;
|
|
693
719
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import './extension/IAgoraMediaPlayerSourceExtension';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
CacheStatistics,
|
|
4
4
|
MediaPlayerEvent,
|
|
5
|
+
MediaPlayerReason,
|
|
5
6
|
MediaPlayerState,
|
|
7
|
+
PlayerPlaybackStats,
|
|
6
8
|
PlayerPreloadEvent,
|
|
7
9
|
PlayerUpdatedInfo,
|
|
8
10
|
SrcInfo,
|
|
@@ -18,21 +20,22 @@ export interface IMediaPlayerSourceObserver {
|
|
|
18
20
|
* When the state of the media player changes, the SDK triggers this callback to report the current playback state.
|
|
19
21
|
*
|
|
20
22
|
* @param state The playback state. See MediaPlayerState.
|
|
21
|
-
* @param
|
|
23
|
+
* @param reason The reason for the changes in the media player status. See MediaPlayerReason.
|
|
22
24
|
*/
|
|
23
25
|
onPlayerSourceStateChanged?(
|
|
24
26
|
state: MediaPlayerState,
|
|
25
|
-
|
|
27
|
+
reason: MediaPlayerReason
|
|
26
28
|
): void;
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
* Reports
|
|
31
|
+
* Reports the playback progress of the media file.
|
|
30
32
|
*
|
|
31
33
|
* When playing media files, the SDK triggers this callback every two second to report current playback progress.
|
|
32
34
|
*
|
|
33
|
-
* @param
|
|
35
|
+
* @param positionMs The playback position (ms) of media files.
|
|
36
|
+
* @param timeStampMs The NTP timestamp (ms) of the current playback progress.
|
|
34
37
|
*/
|
|
35
|
-
onPositionChanged?(positionMs: number): void;
|
|
38
|
+
onPositionChanged?(positionMs: number, timestampMs: number): void;
|
|
36
39
|
|
|
37
40
|
/**
|
|
38
41
|
* Reports the player events.
|
|
@@ -105,6 +108,24 @@ export interface IMediaPlayerSourceObserver {
|
|
|
105
108
|
*/
|
|
106
109
|
onPlayerInfoUpdated?(info: PlayerUpdatedInfo): void;
|
|
107
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Reports the statistics of the media file being cached.
|
|
113
|
+
*
|
|
114
|
+
* After you call the openWithMediaSource method and set enableCache as true, the SDK triggers this callback once per second to report the statistics of the media file being cached.
|
|
115
|
+
*
|
|
116
|
+
* @param stats The statistics of the media file being cached. See CacheStatistics.
|
|
117
|
+
*/
|
|
118
|
+
onPlayerCacheStats?(stats: CacheStatistics): void;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The statistics of the media file being played.
|
|
122
|
+
*
|
|
123
|
+
* The SDK triggers this callback once per second to report the statistics of the media file being played.
|
|
124
|
+
*
|
|
125
|
+
* @param stats The statistics of the media file. See PlayerPlaybackStats.
|
|
126
|
+
*/
|
|
127
|
+
onPlayerPlaybackStats?(stats: PlayerPlaybackStats): void;
|
|
128
|
+
|
|
108
129
|
/**
|
|
109
130
|
* Reports the volume of the media player.
|
|
110
131
|
*
|
|
@@ -1,80 +1,81 @@
|
|
|
1
1
|
import './extension/IAgoraMediaStreamingSourceExtension';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/* enum_StreamingSrcErr */
|
|
3
4
|
export enum StreamingSrcErr {
|
|
4
|
-
/*
|
|
5
|
+
/* enum_StreamingSrcErr_StreamingSrcErrNone */
|
|
5
6
|
StreamingSrcErrNone = 0,
|
|
6
|
-
/*
|
|
7
|
+
/* enum_StreamingSrcErr_StreamingSrcErrUnknown */
|
|
7
8
|
StreamingSrcErrUnknown = 1,
|
|
8
|
-
/*
|
|
9
|
+
/* enum_StreamingSrcErr_StreamingSrcErrInvalidParam */
|
|
9
10
|
StreamingSrcErrInvalidParam = 2,
|
|
10
|
-
/*
|
|
11
|
+
/* enum_StreamingSrcErr_StreamingSrcErrBadState */
|
|
11
12
|
StreamingSrcErrBadState = 3,
|
|
12
|
-
/*
|
|
13
|
+
/* enum_StreamingSrcErr_StreamingSrcErrNoMem */
|
|
13
14
|
StreamingSrcErrNoMem = 4,
|
|
14
|
-
/*
|
|
15
|
+
/* enum_StreamingSrcErr_StreamingSrcErrBufferOverflow */
|
|
15
16
|
StreamingSrcErrBufferOverflow = 5,
|
|
16
|
-
/*
|
|
17
|
+
/* enum_StreamingSrcErr_StreamingSrcErrBufferUnderflow */
|
|
17
18
|
StreamingSrcErrBufferUnderflow = 6,
|
|
18
|
-
/*
|
|
19
|
+
/* enum_StreamingSrcErr_StreamingSrcErrNotFound */
|
|
19
20
|
StreamingSrcErrNotFound = 7,
|
|
20
|
-
/*
|
|
21
|
+
/* enum_StreamingSrcErr_StreamingSrcErrTimeout */
|
|
21
22
|
StreamingSrcErrTimeout = 8,
|
|
22
|
-
/*
|
|
23
|
+
/* enum_StreamingSrcErr_StreamingSrcErrExpired */
|
|
23
24
|
StreamingSrcErrExpired = 9,
|
|
24
|
-
/*
|
|
25
|
+
/* enum_StreamingSrcErr_StreamingSrcErrUnsupported */
|
|
25
26
|
StreamingSrcErrUnsupported = 10,
|
|
26
|
-
/*
|
|
27
|
+
/* enum_StreamingSrcErr_StreamingSrcErrNotExist */
|
|
27
28
|
StreamingSrcErrNotExist = 11,
|
|
28
|
-
/*
|
|
29
|
+
/* enum_StreamingSrcErr_StreamingSrcErrExist */
|
|
29
30
|
StreamingSrcErrExist = 12,
|
|
30
|
-
/*
|
|
31
|
+
/* enum_StreamingSrcErr_StreamingSrcErrOpen */
|
|
31
32
|
StreamingSrcErrOpen = 13,
|
|
32
|
-
/*
|
|
33
|
+
/* enum_StreamingSrcErr_StreamingSrcErrClose */
|
|
33
34
|
StreamingSrcErrClose = 14,
|
|
34
|
-
/*
|
|
35
|
+
/* enum_StreamingSrcErr_StreamingSrcErrRead */
|
|
35
36
|
StreamingSrcErrRead = 15,
|
|
36
|
-
/*
|
|
37
|
+
/* enum_StreamingSrcErr_StreamingSrcErrWrite */
|
|
37
38
|
StreamingSrcErrWrite = 16,
|
|
38
|
-
/*
|
|
39
|
+
/* enum_StreamingSrcErr_StreamingSrcErrSeek */
|
|
39
40
|
StreamingSrcErrSeek = 17,
|
|
40
|
-
/*
|
|
41
|
+
/* enum_StreamingSrcErr_StreamingSrcErrEof */
|
|
41
42
|
StreamingSrcErrEof = 18,
|
|
42
|
-
/*
|
|
43
|
+
/* enum_StreamingSrcErr_StreamingSrcErrCodecopen */
|
|
43
44
|
StreamingSrcErrCodecopen = 19,
|
|
44
|
-
/*
|
|
45
|
+
/* enum_StreamingSrcErr_StreamingSrcErrCodecclose */
|
|
45
46
|
StreamingSrcErrCodecclose = 20,
|
|
46
|
-
/*
|
|
47
|
+
/* enum_StreamingSrcErr_StreamingSrcErrCodecproc */
|
|
47
48
|
StreamingSrcErrCodecproc = 21,
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
/*
|
|
51
|
+
/* enum_StreamingSrcState */
|
|
51
52
|
export enum StreamingSrcState {
|
|
52
|
-
/*
|
|
53
|
+
/* enum_StreamingSrcState_StreamingSrcStateClosed */
|
|
53
54
|
StreamingSrcStateClosed = 0,
|
|
54
|
-
/*
|
|
55
|
+
/* enum_StreamingSrcState_StreamingSrcStateOpening */
|
|
55
56
|
StreamingSrcStateOpening = 1,
|
|
56
|
-
/*
|
|
57
|
+
/* enum_StreamingSrcState_StreamingSrcStateIdle */
|
|
57
58
|
StreamingSrcStateIdle = 2,
|
|
58
|
-
/*
|
|
59
|
+
/* enum_StreamingSrcState_StreamingSrcStatePlaying */
|
|
59
60
|
StreamingSrcStatePlaying = 3,
|
|
60
|
-
/*
|
|
61
|
+
/* enum_StreamingSrcState_StreamingSrcStateSeeking */
|
|
61
62
|
StreamingSrcStateSeeking = 4,
|
|
62
|
-
/*
|
|
63
|
+
/* enum_StreamingSrcState_StreamingSrcStateEof */
|
|
63
64
|
StreamingSrcStateEof = 5,
|
|
64
|
-
/*
|
|
65
|
+
/* enum_StreamingSrcState_StreamingSrcStateError */
|
|
65
66
|
StreamingSrcStateError = 6,
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
/*
|
|
69
|
+
/* class_InputSeiData */
|
|
69
70
|
export class InputSeiData {
|
|
70
|
-
/*
|
|
71
|
+
/* class_InputSeiData_type */
|
|
71
72
|
type?: number;
|
|
72
|
-
/*
|
|
73
|
+
/* class_InputSeiData_timestamp */
|
|
73
74
|
timestamp?: number;
|
|
74
|
-
/*
|
|
75
|
+
/* class_InputSeiData_frame_index */
|
|
75
76
|
frame_index?: number;
|
|
76
|
-
/*
|
|
77
|
+
/* class_InputSeiData_private_data */
|
|
77
78
|
private_data?: Uint8Array;
|
|
78
|
-
/*
|
|
79
|
+
/* class_InputSeiData_data_size */
|
|
79
80
|
data_size?: number;
|
|
80
81
|
}
|
|
@@ -4,61 +4,61 @@ import { IMediaPlayer } from './IAgoraMediaPlayer';
|
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
7
|
-
export enum
|
|
7
|
+
export enum PreloadState {
|
|
8
8
|
/**
|
|
9
9
|
* @ignore
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
KPreloadStateCompleted = 0,
|
|
12
12
|
/**
|
|
13
13
|
* @ignore
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
KPreloadStateFailed = 1,
|
|
16
16
|
/**
|
|
17
17
|
* @ignore
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
KPreloadStatePreloading = 2,
|
|
20
20
|
/**
|
|
21
21
|
* @ignore
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
KPreloadStateRemoved = 3,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @ignore
|
|
28
28
|
*/
|
|
29
|
-
export enum
|
|
29
|
+
export enum MusicContentCenterStateReason {
|
|
30
30
|
/**
|
|
31
31
|
* @ignore
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
KMusicContentCenterReasonOk = 0,
|
|
34
34
|
/**
|
|
35
35
|
* @ignore
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
KMusicContentCenterReasonError = 1,
|
|
38
38
|
/**
|
|
39
39
|
* @ignore
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
KMusicContentCenterReasonGateway = 2,
|
|
42
42
|
/**
|
|
43
43
|
* @ignore
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
KMusicContentCenterReasonPermissionAndResource = 3,
|
|
46
46
|
/**
|
|
47
47
|
* @ignore
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
KMusicContentCenterReasonInternalDataParse = 4,
|
|
50
50
|
/**
|
|
51
51
|
* @ignore
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
KMusicContentCenterReasonMusicLoading = 5,
|
|
54
54
|
/**
|
|
55
55
|
* @ignore
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
KMusicContentCenterReasonMusicDecryption = 6,
|
|
58
58
|
/**
|
|
59
59
|
* @ignore
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
KMusicContentCenterReasonHttpInternalError = 7,
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -248,7 +248,7 @@ export interface IMusicContentCenterEventHandler {
|
|
|
248
248
|
onMusicChartsResult?(
|
|
249
249
|
requestId: string,
|
|
250
250
|
result: MusicChartInfo[],
|
|
251
|
-
|
|
251
|
+
reason: MusicContentCenterStateReason
|
|
252
252
|
): void;
|
|
253
253
|
|
|
254
254
|
/**
|
|
@@ -257,7 +257,7 @@ export interface IMusicContentCenterEventHandler {
|
|
|
257
257
|
onMusicCollectionResult?(
|
|
258
258
|
requestId: string,
|
|
259
259
|
result: MusicCollection,
|
|
260
|
-
|
|
260
|
+
reason: MusicContentCenterStateReason
|
|
261
261
|
): void;
|
|
262
262
|
|
|
263
263
|
/**
|
|
@@ -267,7 +267,7 @@ export interface IMusicContentCenterEventHandler {
|
|
|
267
267
|
requestId: string,
|
|
268
268
|
songCode: number,
|
|
269
269
|
lyricUrl: string,
|
|
270
|
-
|
|
270
|
+
reason: MusicContentCenterStateReason
|
|
271
271
|
): void;
|
|
272
272
|
|
|
273
273
|
/**
|
|
@@ -277,7 +277,7 @@ export interface IMusicContentCenterEventHandler {
|
|
|
277
277
|
requestId: string,
|
|
278
278
|
songCode: number,
|
|
279
279
|
simpleInfo: string,
|
|
280
|
-
|
|
280
|
+
reason: MusicContentCenterStateReason
|
|
281
281
|
): void;
|
|
282
282
|
|
|
283
283
|
/**
|
|
@@ -288,8 +288,8 @@ export interface IMusicContentCenterEventHandler {
|
|
|
288
288
|
songCode: number,
|
|
289
289
|
percent: number,
|
|
290
290
|
lyricUrl: string,
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
state: PreloadState,
|
|
292
|
+
reason: MusicContentCenterStateReason
|
|
293
293
|
): void;
|
|
294
294
|
}
|
|
295
295
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './extension/IAgoraRhythmPlayerExtension';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* @ignore
|
|
4
5
|
*/
|
|
@@ -28,27 +29,27 @@ export enum RhythmPlayerStateType {
|
|
|
28
29
|
/**
|
|
29
30
|
* @ignore
|
|
30
31
|
*/
|
|
31
|
-
export enum
|
|
32
|
+
export enum RhythmPlayerReason {
|
|
32
33
|
/**
|
|
33
34
|
* @ignore
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
+
RhythmPlayerReasonOk = 0,
|
|
36
37
|
/**
|
|
37
38
|
* @ignore
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
|
+
RhythmPlayerReasonFailed = 1,
|
|
40
41
|
/**
|
|
41
42
|
* @ignore
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
+
RhythmPlayerReasonCanNotOpen = 801,
|
|
44
45
|
/**
|
|
45
46
|
* @ignore
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
RhythmPlayerReasonCanNotPlay = 802,
|
|
48
49
|
/**
|
|
49
50
|
* @ignore
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
RhythmPlayerReasonFileOverDurationLimit = 803,
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
/**
|