agora-electron-sdk 4.1.1-rc.1 → 4.2.0-dev.13
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/LICENSE +21 -21
- package/README.md +143 -143
- package/gulpfile.js +5 -4
- package/js/AgoraSdk.js +62 -60
- package/js/Private/AgoraBase.js +4575 -3269
- package/js/Private/AgoraMediaBase.js +968 -564
- package/js/Private/AgoraMediaPlayerTypes.js +422 -310
- package/js/Private/IAgoraLog.js +86 -74
- package/js/Private/IAgoraMediaEngine.js +32 -32
- package/js/Private/IAgoraMediaPlayer.js +16 -16
- package/js/Private/IAgoraMediaPlayerSource.js +3 -3
- package/js/Private/IAgoraMediaRecorder.js +12 -12
- package/js/Private/IAgoraMediaStreamingSource.js +84 -0
- package/js/Private/IAgoraMusicContentCenter.js +239 -81
- package/js/Private/IAgoraRhythmPlayer.js +70 -62
- package/js/Private/IAgoraRtcEngine.js +1807 -948
- package/js/Private/IAgoraRtcEngineEx.js +26 -18
- package/js/Private/IAgoraSpatialAudio.js +74 -30
- package/js/Private/IAudioDeviceManager.js +20 -20
- package/js/Private/extension/AgoraBaseExtension.js +2 -2
- package/js/Private/extension/AgoraMediaBaseExtension.js +2 -2
- package/js/Private/extension/AgoraMediaPlayerTypesExtension.js +2 -2
- package/js/Private/extension/IAgoraLogExtension.js +2 -2
- package/js/Private/extension/IAgoraMediaEngineExtension.js +2 -2
- package/js/Private/extension/IAgoraMediaPlayerExtension.js +2 -2
- package/js/Private/extension/IAgoraMediaPlayerSourceExtension.js +2 -2
- package/js/Private/extension/IAgoraMediaRecorderExtension.js +2 -2
- package/js/Private/extension/IAgoraMusicContentCenterExtension.js +2 -2
- package/js/Private/extension/IAgoraRhythmPlayerExtension.js +2 -2
- package/js/Private/extension/IAgoraRtcEngineExExtension.js +2 -2
- package/js/Private/extension/IAgoraRtcEngineExtension.js +2 -2
- package/js/Private/extension/IAgoraSpatialAudioExtension.js +2 -2
- package/js/Private/extension/IAudioDeviceManagerExtension.js +2 -2
- package/js/Private/impl/AgoraBaseImpl.js +23 -23
- package/js/Private/impl/AgoraMediaBaseImpl.js +118 -138
- package/js/Private/impl/IAgoraMediaEngineImpl.js +287 -325
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +932 -938
- package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +63 -63
- package/js/Private/impl/IAgoraMediaRecorderImpl.js +47 -67
- package/js/Private/impl/IAgoraMusicContentCenterImpl.js +353 -323
- package/js/Private/impl/IAgoraRtcEngineExImpl.js +945 -907
- package/js/Private/impl/IAgoraRtcEngineImpl.js +4742 -4702
- package/js/Private/impl/IAgoraSpatialAudioImpl.js +362 -362
- package/js/Private/impl/IAudioDeviceManagerImpl.js +375 -375
- package/js/Private/internal/AudioDeviceManagerInternal.js +44 -44
- package/js/Private/internal/IrisApiEngine.js +391 -382
- package/js/Private/internal/LocalSpatialAudioEngineInternal.js +46 -46
- package/js/Private/internal/MediaEngineInternal.js +119 -123
- package/js/Private/internal/MediaPlayerInternal.js +215 -213
- package/js/Private/internal/MediaRecorderInternal.js +82 -81
- package/js/Private/internal/MusicContentCenterInternal.js +128 -130
- package/js/Private/internal/RtcEngineExInternal.js +422 -363
- package/js/Private/internal/emitter/EventEmitter.js +111 -111
- package/js/Private/ti/AgoraBase-ti.js +40 -40
- package/js/Private/ti/AgoraMediaBase-ti.js +71 -73
- package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +5 -5
- package/js/Private/ti/IAgoraLog-ti.js +5 -5
- package/js/Private/ti/IAgoraMediaEngine-ti.js +5 -5
- package/js/Private/ti/IAgoraMediaPlayer-ti.js +38 -42
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +48 -48
- package/js/Private/ti/IAgoraMediaRecorder-ti.js +5 -5
- package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +5 -0
- package/js/Private/ti/IAgoraMusicContentCenter-ti.js +41 -41
- package/js/Private/ti/IAgoraRhythmPlayer-ti.js +5 -5
- package/js/Private/ti/IAgoraRtcEngine-ti.js +139 -139
- package/js/Private/ti/IAgoraRtcEngineEx-ti.js +5 -5
- package/js/Private/ti/IAgoraSpatialAudio-ti.js +5 -5
- package/js/Private/ti/IAudioDeviceManager-ti.js +5 -5
- package/js/Renderer/AgoraView.js +128 -131
- package/js/Renderer/IRenderer.js +40 -48
- package/js/Renderer/IRendererManager.js +9 -0
- package/js/Renderer/RendererManager.js +479 -392
- package/js/Renderer/{GlRenderer → WebGLRenderer}/index.js +469 -473
- package/js/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +1337 -1337
- package/js/Renderer/YUVCanvasRenderer/index.js +195 -185
- package/js/Renderer/index.js +18 -0
- package/js/Types.js +17 -29
- package/js/Utils.js +168 -173
- package/package.json +61 -103
- package/scripts/bootstrap.js +1 -1
- package/scripts/build.js +1 -0
- package/scripts/buildJS.js +3 -3
- package/scripts/clean.js +2 -1
- package/scripts/downloadPrebuild.js +5 -5
- package/scripts/getConfig.js +3 -2
- package/scripts/synclib.js +8 -5
- package/scripts/util.js +3 -2
- package/scripts/zipBuild.js +2 -1
- package/ts/AgoraSdk.ts +9 -6
- package/ts/Private/AgoraBase.ts +278 -173
- package/ts/Private/AgoraMediaBase.ts +167 -100
- package/ts/Private/AgoraMediaPlayerTypes.ts +1 -1
- package/ts/Private/IAgoraMediaEngine.ts +43 -56
- package/ts/Private/IAgoraMediaPlayer.ts +90 -104
- package/ts/Private/IAgoraMediaPlayerSource.ts +3 -8
- package/ts/Private/IAgoraMediaRecorder.ts +8 -35
- package/ts/Private/IAgoraMediaStreamingSource.ts +80 -0
- package/ts/Private/IAgoraMusicContentCenter.ts +93 -12
- package/ts/Private/IAgoraRtcEngine.ts +807 -910
- package/ts/Private/IAgoraRtcEngineEx.ts +187 -191
- package/ts/Private/IAgoraSpatialAudio.ts +40 -22
- package/ts/Private/IAudioDeviceManager.ts +35 -13
- package/ts/Private/extension/IAgoraMediaEngineExtension.ts +1 -1
- package/ts/Private/extension/IAgoraMediaPlayerExtension.ts +4 -7
- package/ts/Private/extension/IAgoraMediaRecorderExtension.ts +6 -1
- package/ts/Private/extension/IAgoraMusicContentCenterExtension.ts +1 -1
- package/ts/Private/extension/IAgoraRtcEngineExtension.ts +4 -4
- package/ts/Private/impl/AgoraBaseImpl.ts +3 -3
- package/ts/Private/impl/AgoraMediaBaseImpl.ts +36 -42
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +79 -127
- package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +106 -106
- package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +13 -45
- package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +61 -16
- package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +129 -59
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +490 -416
- package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +5 -3
- package/ts/Private/impl/IAudioDeviceManagerImpl.ts +4 -2
- package/ts/Private/internal/AudioDeviceManagerInternal.ts +6 -5
- package/ts/Private/internal/IrisApiEngine.ts +41 -32
- package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +17 -13
- package/ts/Private/internal/MediaEngineInternal.ts +9 -11
- package/ts/Private/internal/MediaPlayerInternal.ts +42 -31
- package/ts/Private/internal/MediaRecorderInternal.ts +24 -22
- package/ts/Private/internal/MusicContentCenterInternal.ts +16 -18
- package/ts/Private/internal/RtcEngineExInternal.ts +189 -66
- package/ts/Private/ti/AgoraMediaBase-ti.ts +9 -10
- package/ts/Private/ti/IAgoraMediaPlayer-ti.ts +0 -5
- package/{js/Private/ti/AgoraMediaPlayerTypes-ti.d.ts → ts/Private/ti/IAgoraMediaStreamingSource-ti.ts} +11 -6
- package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +4 -4
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +4 -4
- package/ts/Renderer/AgoraView.ts +12 -7
- package/ts/Renderer/IRenderer.ts +11 -16
- package/ts/Renderer/IRendererManager.ts +35 -0
- package/ts/Renderer/RendererManager.ts +146 -82
- package/ts/Renderer/{GlRenderer → WebGLRenderer}/index.ts +36 -51
- package/ts/Renderer/YUVCanvasRenderer/index.ts +41 -25
- package/ts/Renderer/index.ts +2 -0
- package/ts/Types.ts +43 -23
- package/ts/Utils.ts +7 -12
- package/types/AgoraSdk.d.ts +38 -36
- package/types/AgoraSdk.d.ts.map +1 -0
- package/types/Private/AgoraBase.d.ts +4455 -4358
- package/types/Private/AgoraBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaBase.d.ts +1125 -1070
- package/types/Private/AgoraMediaBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaPlayerTypes.d.ts +409 -408
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -0
- package/types/Private/IAgoraLog.d.ts +81 -80
- package/types/Private/IAgoraLog.d.ts.map +1 -0
- package/types/Private/IAgoraMediaEngine.d.ts +184 -193
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayer.d.ts +533 -546
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayerSource.d.ts +83 -88
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -0
- package/types/Private/IAgoraMediaRecorder.d.ts +29 -49
- package/types/Private/IAgoraMediaRecorder.d.ts.map +1 -0
- package/types/Private/IAgoraMediaStreamingSource.d.ts +42 -0
- package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -0
- package/types/Private/IAgoraMusicContentCenter.d.ts +336 -255
- package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -0
- package/types/Private/IAgoraRhythmPlayer.d.ts +65 -64
- package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngine.d.ts +4948 -5058
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngineEx.d.ts +554 -570
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -0
- package/types/Private/IAgoraSpatialAudio.d.ts +266 -248
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -0
- package/types/Private/IAudioDeviceManager.d.ts +255 -233
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -0
- package/types/Private/extension/AgoraBaseExtension.d.ts +2 -1
- package/types/Private/extension/AgoraBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts +2 -1
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +2 -1
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraLogExtension.d.ts +2 -1
- package/types/Private/extension/IAgoraLogExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +41 -40
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts +47 -46
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +2 -1
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts +45 -40
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts +21 -20
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts +2 -1
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts +2 -1
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts +43 -42
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts +2 -1
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts.map +1 -0
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts +2 -1
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts.map +1 -0
- package/types/Private/impl/AgoraBaseImpl.d.ts +3 -2
- package/types/Private/impl/AgoraBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts +9 -7
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +40 -43
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +141 -141
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +3 -2
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts +11 -13
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +59 -51
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +106 -101
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +570 -566
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +49 -48
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -0
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts +65 -64
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts.map +1 -0
- package/types/Private/internal/AudioDeviceManagerInternal.d.ts +9 -8
- package/types/Private/internal/AudioDeviceManagerInternal.d.ts.map +1 -0
- package/types/Private/internal/IrisApiEngine.d.ts +148 -146
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -0
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +19 -18
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaEngineInternal.d.ts +22 -21
- package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaPlayerInternal.d.ts +34 -33
- package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaRecorderInternal.d.ts +18 -15
- package/types/Private/internal/MediaRecorderInternal.d.ts.map +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts +40 -39
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -0
- package/types/Private/internal/RtcEngineExInternal.d.ts +80 -73
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -0
- package/{js → types}/Private/internal/emitter/EventEmitter.d.ts +60 -59
- package/types/Private/internal/emitter/EventEmitter.d.ts.map +1 -0
- package/types/Private/ti/AgoraBase-ti.d.ts +8 -7
- package/types/Private/ti/AgoraBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts +14 -12
- package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +7 -6
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraLog-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraLog-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts +8 -8
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +8 -7
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts.map +1 -0
- package/{js/Private/ti/IAgoraMediaRecorder-ti.d.ts → types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts} +7 -6
- package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts +8 -7
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts +10 -9
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts +7 -6
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts.map +1 -0
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts +7 -6
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts.map +1 -0
- package/types/Renderer/AgoraView.d.ts +70 -70
- package/types/Renderer/AgoraView.d.ts.map +1 -0
- package/types/Renderer/IRenderer.d.ts +22 -21
- 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 +154 -71
- package/types/Renderer/RendererManager.d.ts.map +1 -0
- package/types/Renderer/{GlRenderer → WebGLRenderer}/index.d.ts +49 -59
- 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 +16 -16
- 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 +280 -260
- package/types/Types.d.ts.map +1 -0
- package/types/Utils.d.ts +59 -58
- package/types/Utils.d.ts.map +1 -0
- package/js/AgoraSdk.d.ts +0 -36
- package/js/Private/AgoraBase.d.ts +0 -4358
- package/js/Private/AgoraMediaBase.d.ts +0 -1070
- package/js/Private/AgoraMediaPlayerTypes.d.ts +0 -408
- package/js/Private/IAgoraLog.d.ts +0 -80
- package/js/Private/IAgoraMediaEngine.d.ts +0 -193
- package/js/Private/IAgoraMediaPlayer.d.ts +0 -546
- package/js/Private/IAgoraMediaPlayerSource.d.ts +0 -88
- package/js/Private/IAgoraMediaRecorder.d.ts +0 -49
- package/js/Private/IAgoraMusicContentCenter.d.ts +0 -255
- package/js/Private/IAgoraRhythmPlayer.d.ts +0 -64
- package/js/Private/IAgoraRtcEngine.d.ts +0 -5058
- package/js/Private/IAgoraRtcEngineEx.d.ts +0 -570
- package/js/Private/IAgoraSpatialAudio.d.ts +0 -248
- package/js/Private/IAudioDeviceManager.d.ts +0 -233
- 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 -40
- 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 -7
- package/js/Private/impl/IAgoraMediaEngineImpl.d.ts +0 -43
- package/js/Private/impl/IAgoraMediaPlayerImpl.d.ts +0 -141
- package/js/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +0 -2
- package/js/Private/impl/IAgoraMediaRecorderImpl.d.ts +0 -13
- package/js/Private/impl/IAgoraMusicContentCenterImpl.d.ts +0 -51
- package/js/Private/impl/IAgoraRtcEngineExImpl.d.ts +0 -101
- package/js/Private/impl/IAgoraRtcEngineImpl.d.ts +0 -566
- 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 -146
- 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 -15
- package/js/Private/internal/MusicContentCenterInternal.d.ts +0 -39
- package/js/Private/internal/RtcEngineExInternal.d.ts +0 -73
- package/js/Private/ti/AgoraBase-ti.d.ts +0 -7
- package/js/Private/ti/AgoraMediaBase-ti.d.ts +0 -12
- 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 -8
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +0 -7
- 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 -70
- 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 -71
- package/js/Renderer/YUVCanvasRenderer/index.d.ts +0 -16
- package/js/Types.d.ts +0 -260
- package/js/Utils.d.ts +0 -58
- /package/ts/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const createProgramFromSources =
|
|
2
|
-
require('./webgl-utils').createProgramFromSources;
|
|
3
|
-
|
|
4
1
|
import { EventEmitter } from 'events';
|
|
2
|
+
|
|
3
|
+
import { RenderModeType } from '../../Private/AgoraMediaBase';
|
|
4
|
+
|
|
5
5
|
import { ShareVideoFrame } from '../../Types';
|
|
6
6
|
import { logError, logWarn } from '../../Utils';
|
|
7
7
|
import { IRenderer, RenderFailCallback } from '../IRenderer';
|
|
8
8
|
|
|
9
|
+
const createProgramFromSources =
|
|
10
|
+
require('./webgl-utils').createProgramFromSources;
|
|
11
|
+
|
|
9
12
|
const vertexShaderSource =
|
|
10
13
|
'attribute vec2 a_position;' +
|
|
11
14
|
'attribute vec2 a_texCoord;' +
|
|
@@ -21,7 +24,8 @@ const vertexShaderSource =
|
|
|
21
24
|
const yuvShaderSource =
|
|
22
25
|
'precision mediump float;' +
|
|
23
26
|
'uniform sampler2D Ytex;' +
|
|
24
|
-
'uniform sampler2D Utex
|
|
27
|
+
'uniform sampler2D Utex;' +
|
|
28
|
+
'uniform sampler2D Vtex;' +
|
|
25
29
|
'varying vec2 v_texCoord;' +
|
|
26
30
|
'void main(void) {' +
|
|
27
31
|
' float nx,ny,r,g,b,y,u,v;' +
|
|
@@ -52,8 +56,10 @@ export class GlRenderer extends IRenderer {
|
|
|
52
56
|
texCoordBuffer: any;
|
|
53
57
|
surfaceBuffer: any;
|
|
54
58
|
|
|
59
|
+
// @ts-ignore
|
|
55
60
|
parentElement: HTMLElement | undefined;
|
|
56
61
|
container: HTMLElement | undefined;
|
|
62
|
+
// @ts-ignore
|
|
57
63
|
canvas: HTMLCanvasElement | undefined;
|
|
58
64
|
renderImageCount = 0;
|
|
59
65
|
initWidth = 0;
|
|
@@ -78,28 +84,12 @@ export class GlRenderer extends IRenderer {
|
|
|
78
84
|
this.failInitRenderCB = failCallback;
|
|
79
85
|
}
|
|
80
86
|
|
|
81
|
-
bind(view: HTMLElement) {
|
|
87
|
+
public bind(view: HTMLElement) {
|
|
82
88
|
super.bind(view);
|
|
83
|
-
|
|
84
|
-
// this.initCanvas(
|
|
85
|
-
// view,
|
|
86
|
-
// view.clientWidth,
|
|
87
|
-
// view.clientHeight,
|
|
88
|
-
// this.initRotation,
|
|
89
|
-
// console.warn
|
|
90
|
-
// );
|
|
91
|
-
// const ResizeObserver = window.ResizeObserver;
|
|
92
|
-
// if (ResizeObserver) {
|
|
93
|
-
// this.observer = new ResizeObserver(() => {
|
|
94
|
-
// this.refreshCanvas && this.refreshCanvas();
|
|
95
|
-
// });
|
|
96
|
-
// this.observer.observe(view);
|
|
97
|
-
// }
|
|
98
89
|
}
|
|
99
90
|
|
|
100
|
-
unbind() {
|
|
101
|
-
|
|
102
|
-
this.observer && this.observer.unobserve && this.observer.disconnect();
|
|
91
|
+
public unbind() {
|
|
92
|
+
this.observer?.unobserve && this.observer.disconnect();
|
|
103
93
|
this.program = undefined;
|
|
104
94
|
this.positionLocation = undefined;
|
|
105
95
|
this.texCoordLocation = undefined;
|
|
@@ -142,7 +132,7 @@ export class GlRenderer extends IRenderer {
|
|
|
142
132
|
this.parentElement = undefined;
|
|
143
133
|
}
|
|
144
134
|
|
|
145
|
-
updateViewZoomLevel(rotation: number, width: number, height: number) {
|
|
135
|
+
private updateViewZoomLevel(rotation: number, width: number, height: number) {
|
|
146
136
|
if (!this.parentElement || !this.canvas) {
|
|
147
137
|
return;
|
|
148
138
|
}
|
|
@@ -150,43 +140,37 @@ export class GlRenderer extends IRenderer {
|
|
|
150
140
|
this.clientHeight = this.parentElement.clientHeight;
|
|
151
141
|
|
|
152
142
|
try {
|
|
153
|
-
if (this.contentMode ===
|
|
143
|
+
if (this.contentMode === RenderModeType.RenderModeHidden) {
|
|
154
144
|
// Cover
|
|
155
145
|
if (rotation === 0 || rotation === 180) {
|
|
156
146
|
if (this.clientWidth / this.clientHeight > width / height) {
|
|
157
|
-
|
|
158
|
-
this.canvas.style.zoom = this.clientWidth / width;
|
|
147
|
+
this.canvas.style.transform = `scale(${this.clientWidth / width})`;
|
|
159
148
|
} else {
|
|
160
|
-
|
|
161
|
-
|
|
149
|
+
this.canvas.style.transform = `scale(${
|
|
150
|
+
this.clientHeight / height
|
|
151
|
+
})`;
|
|
162
152
|
}
|
|
163
153
|
} else {
|
|
164
154
|
// 90, 270
|
|
165
155
|
if (this.clientHeight / this.clientWidth > width / height) {
|
|
166
|
-
|
|
167
|
-
this.canvas.style.zoom = this.clientHeight / width;
|
|
156
|
+
this.canvas.style.transform = `scale(${this.clientHeight / width})`;
|
|
168
157
|
} else {
|
|
169
|
-
|
|
170
|
-
this.canvas.style.zoom = this.clientWidth / height;
|
|
158
|
+
this.canvas.style.transform = `scale(${this.clientWidth / height})`;
|
|
171
159
|
}
|
|
172
160
|
}
|
|
173
161
|
// Contain
|
|
174
162
|
} else if (rotation === 0 || rotation === 180) {
|
|
175
163
|
if (this.clientWidth / this.clientHeight > width / height) {
|
|
176
|
-
|
|
177
|
-
this.canvas.style.zoom = this.clientHeight / height;
|
|
164
|
+
this.canvas.style.transform = `scale(${this.clientHeight / height})`;
|
|
178
165
|
} else {
|
|
179
|
-
|
|
180
|
-
this.canvas.style.zoom = this.clientWidth / width;
|
|
166
|
+
this.canvas.style.transform = `scale(${this.clientWidth / width})`;
|
|
181
167
|
}
|
|
182
168
|
} else {
|
|
183
169
|
// 90, 270
|
|
184
170
|
if (this.clientHeight / this.clientWidth > width / height) {
|
|
185
|
-
|
|
186
|
-
this.canvas.style.zoom = this.clientWidth / height;
|
|
171
|
+
this.canvas.style.transform = `scale(${this.clientWidth / height})`;
|
|
187
172
|
} else {
|
|
188
|
-
|
|
189
|
-
this.canvas.style.zoom = this.clientHeight / width;
|
|
173
|
+
this.canvas.style.transform = `scale(${this.clientHeight / width})`;
|
|
190
174
|
}
|
|
191
175
|
}
|
|
192
176
|
} catch (e) {
|
|
@@ -197,7 +181,7 @@ export class GlRenderer extends IRenderer {
|
|
|
197
181
|
return true;
|
|
198
182
|
}
|
|
199
183
|
|
|
200
|
-
updateCanvas(rotation: number, width: number, height: number) {
|
|
184
|
+
private updateCanvas(rotation: number, width: number, height: number) {
|
|
201
185
|
// if (this.canvasUpdated) {
|
|
202
186
|
// return;
|
|
203
187
|
// }
|
|
@@ -284,7 +268,7 @@ export class GlRenderer extends IRenderer {
|
|
|
284
268
|
gl.uniform2f(resolutionLocation, width, height);
|
|
285
269
|
}
|
|
286
270
|
|
|
287
|
-
drawFrame(videoFrame: ShareVideoFrame) {
|
|
271
|
+
public drawFrame(videoFrame: ShareVideoFrame) {
|
|
288
272
|
let error;
|
|
289
273
|
try {
|
|
290
274
|
this.renderImage({
|
|
@@ -292,7 +276,7 @@ export class GlRenderer extends IRenderer {
|
|
|
292
276
|
height: videoFrame.height,
|
|
293
277
|
left: 0,
|
|
294
278
|
top: 0,
|
|
295
|
-
right:
|
|
279
|
+
right: videoFrame.yStride - videoFrame.width,
|
|
296
280
|
bottom: 0,
|
|
297
281
|
rotation: videoFrame.rotation || 0,
|
|
298
282
|
yplane: videoFrame.yBuffer,
|
|
@@ -312,7 +296,7 @@ export class GlRenderer extends IRenderer {
|
|
|
312
296
|
}
|
|
313
297
|
}
|
|
314
298
|
|
|
315
|
-
refreshCanvas() {
|
|
299
|
+
public refreshCanvas() {
|
|
316
300
|
if (this.lastImageWidth) {
|
|
317
301
|
this.updateViewZoomLevel(
|
|
318
302
|
this.lastImageRotation,
|
|
@@ -322,7 +306,7 @@ export class GlRenderer extends IRenderer {
|
|
|
322
306
|
}
|
|
323
307
|
}
|
|
324
308
|
|
|
325
|
-
renderImage(image: {
|
|
309
|
+
private renderImage(image: {
|
|
326
310
|
width: number;
|
|
327
311
|
height: number;
|
|
328
312
|
left: number;
|
|
@@ -394,7 +378,7 @@ export class GlRenderer extends IRenderer {
|
|
|
394
378
|
}
|
|
395
379
|
}
|
|
396
380
|
|
|
397
|
-
uploadYuv(
|
|
381
|
+
private uploadYuv(
|
|
398
382
|
width: number,
|
|
399
383
|
height: number,
|
|
400
384
|
yplane: Uint8Array,
|
|
@@ -452,19 +436,19 @@ export class GlRenderer extends IRenderer {
|
|
|
452
436
|
);
|
|
453
437
|
}
|
|
454
438
|
|
|
455
|
-
deleteBuffer(buffer: any) {
|
|
439
|
+
private deleteBuffer(buffer: any) {
|
|
456
440
|
if (buffer && this.gl) {
|
|
457
441
|
this.gl.deleteBuffer(buffer);
|
|
458
442
|
}
|
|
459
443
|
}
|
|
460
444
|
|
|
461
|
-
deleteTexture(texture: any) {
|
|
445
|
+
private deleteTexture(texture: any) {
|
|
462
446
|
if (texture && this.gl) {
|
|
463
447
|
this.gl.deleteTexture(texture);
|
|
464
448
|
}
|
|
465
449
|
}
|
|
466
450
|
|
|
467
|
-
initCanvas(
|
|
451
|
+
private initCanvas(
|
|
468
452
|
view: HTMLElement,
|
|
469
453
|
width: number,
|
|
470
454
|
height: number,
|
|
@@ -557,7 +541,8 @@ export class GlRenderer extends IRenderer {
|
|
|
557
541
|
|
|
558
542
|
this.initTextures();
|
|
559
543
|
}
|
|
560
|
-
|
|
544
|
+
|
|
545
|
+
private initTextures() {
|
|
561
546
|
let gl = this.gl;
|
|
562
547
|
if (!gl) {
|
|
563
548
|
return;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* @Last Modified time: 2021-05-19 15:59:03
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const YUVBuffer = require('yuv-buffer');
|
|
9
|
-
const YUVCanvas = require('yuv-canvas');
|
|
10
|
-
const isEqual = require('lodash.isequal');
|
|
11
|
-
|
|
12
8
|
import { RenderModeType } from '../../Private/AgoraMediaBase';
|
|
13
9
|
import { CanvasOptions, ShareVideoFrame } from '../../Types';
|
|
14
10
|
import { IRenderer } from '../IRenderer';
|
|
15
11
|
|
|
12
|
+
const isEqual = require('lodash.isequal');
|
|
13
|
+
const YUVBuffer = require('yuv-buffer');
|
|
14
|
+
const YUVCanvas = require('yuv-canvas');
|
|
15
|
+
|
|
16
16
|
export class YUVCanvasRenderer extends IRenderer {
|
|
17
17
|
private _cacheCanvasOptions?: CanvasOptions;
|
|
18
18
|
private _yuvCanvasSink?: any;
|
|
@@ -25,6 +25,7 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
25
25
|
rotation: 0,
|
|
26
26
|
width: 0,
|
|
27
27
|
height: 0,
|
|
28
|
+
yStride: 0,
|
|
28
29
|
yBuffer: new Uint8Array(0),
|
|
29
30
|
uBuffer: new Uint8Array(0),
|
|
30
31
|
vBuffer: new Uint8Array(0),
|
|
@@ -32,7 +33,7 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
bind(element: HTMLElement) {
|
|
36
|
+
public bind(element: HTMLElement) {
|
|
36
37
|
super.bind(element);
|
|
37
38
|
let container = document.createElement('div');
|
|
38
39
|
Object.assign(container.style, {
|
|
@@ -53,7 +54,7 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
unbind() {
|
|
57
|
+
public unbind() {
|
|
57
58
|
if (this._container) {
|
|
58
59
|
this._container.replaceChildren();
|
|
59
60
|
this._container = undefined;
|
|
@@ -70,7 +71,7 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
zoom(
|
|
74
|
+
private zoom(
|
|
74
75
|
vertical: boolean,
|
|
75
76
|
contentMode: RenderModeType = RenderModeType.RenderModeFit,
|
|
76
77
|
width: number,
|
|
@@ -107,7 +108,7 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
updateCanvas(
|
|
111
|
+
private updateCanvas(
|
|
111
112
|
options: CanvasOptions = {
|
|
112
113
|
frameWidth: 0,
|
|
113
114
|
frameHeight: 0,
|
|
@@ -155,17 +156,15 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
155
156
|
options.clientHeight
|
|
156
157
|
);
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
this.canvas.style.zoom = scale.toString();
|
|
159
|
+
this.canvas.style.transform = `scale(${scale.toString()})`;
|
|
160
160
|
|
|
161
161
|
if (transformItems.length > 0) {
|
|
162
|
-
|
|
163
|
-
this.canvas.style.transform = transform;
|
|
162
|
+
this.canvas.style.transform = `${transformItems.join(' ')}`;
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
|
|
168
|
-
drawFrame(frame: ShareVideoFrame) {
|
|
167
|
+
public drawFrame(frame: ShareVideoFrame) {
|
|
169
168
|
if (!this._container || !this._yuvCanvasSink) {
|
|
170
169
|
return;
|
|
171
170
|
}
|
|
@@ -174,14 +173,18 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
174
173
|
let frameHeight = frame.height;
|
|
175
174
|
|
|
176
175
|
if (
|
|
177
|
-
this._videoFrame.
|
|
176
|
+
this._videoFrame.yStride === 0 ||
|
|
178
177
|
this._videoFrame.height === 0 ||
|
|
179
|
-
this._videoFrame.
|
|
178
|
+
this._videoFrame.yStride != frame.yStride ||
|
|
180
179
|
this._videoFrame.height != frame.height
|
|
181
180
|
) {
|
|
182
|
-
this._videoFrame.yBuffer = new Uint8Array(
|
|
183
|
-
this._videoFrame.uBuffer = new Uint8Array(
|
|
184
|
-
|
|
181
|
+
this._videoFrame.yBuffer = new Uint8Array(frame.yStride * frameHeight);
|
|
182
|
+
this._videoFrame.uBuffer = new Uint8Array(
|
|
183
|
+
(frame.yStride * frameHeight) / 4
|
|
184
|
+
);
|
|
185
|
+
this._videoFrame.vBuffer = new Uint8Array(
|
|
186
|
+
(frame.yStride * frameHeight) / 4
|
|
187
|
+
);
|
|
185
188
|
}
|
|
186
189
|
|
|
187
190
|
this._videoFrame.yBuffer.set(frame.yBuffer);
|
|
@@ -190,11 +193,12 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
190
193
|
|
|
191
194
|
this._videoFrame.width = frame.width;
|
|
192
195
|
this._videoFrame.height = frame.height;
|
|
196
|
+
this._videoFrame.yStride = frame.yStride;
|
|
193
197
|
this._videoFrame.rotation = frame.rotation;
|
|
194
198
|
|
|
195
199
|
let options: CanvasOptions = {
|
|
196
|
-
frameWidth
|
|
197
|
-
frameHeight
|
|
200
|
+
frameWidth,
|
|
201
|
+
frameHeight,
|
|
198
202
|
rotation: frame.rotation ? frame.rotation : 0,
|
|
199
203
|
contentMode: this.contentMode,
|
|
200
204
|
clientWidth: this._container.clientWidth,
|
|
@@ -208,16 +212,28 @@ export class YUVCanvasRenderer extends IRenderer {
|
|
|
208
212
|
height: frameHeight,
|
|
209
213
|
chromaWidth: frameWidth / 2,
|
|
210
214
|
chromaHeight: frameHeight / 2,
|
|
215
|
+
cropLeft: frame.yStride - frameWidth,
|
|
211
216
|
});
|
|
212
217
|
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
let yuvBufferFrame = YUVBuffer.frame(
|
|
219
|
+
format,
|
|
220
|
+
{
|
|
221
|
+
bytes: this._videoFrame.yBuffer,
|
|
222
|
+
stride: frame.yStride,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
bytes: this._videoFrame.uBuffer,
|
|
226
|
+
stride: frame.yStride / 2,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
bytes: this._videoFrame.vBuffer,
|
|
230
|
+
stride: frame.yStride / 2,
|
|
231
|
+
}
|
|
232
|
+
);
|
|
217
233
|
this._yuvCanvasSink.drawFrame(yuvBufferFrame);
|
|
218
234
|
}
|
|
219
235
|
|
|
220
|
-
refreshCanvas() {
|
|
236
|
+
public refreshCanvas() {
|
|
221
237
|
if (this._cacheCanvasOptions) {
|
|
222
238
|
this.zoom(
|
|
223
239
|
this._cacheCanvasOptions.rotation === 90 ||
|
package/ts/Types.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import { VideoSourceType } from './Private/
|
|
2
|
-
import {
|
|
3
|
-
import { IRenderer } from './Renderer/IRenderer';
|
|
4
|
-
import { RendererManager } from './Renderer/RendererManager';
|
|
1
|
+
import { RenderModeType, VideoSourceType } from './Private/AgoraMediaBase';
|
|
2
|
+
import { IRenderer, IRendererManager } from './Renderer';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* @ignore
|
|
8
6
|
*/
|
|
9
|
-
export interface
|
|
7
|
+
export interface AgoraEnvOptions {
|
|
10
8
|
/**
|
|
11
9
|
* @ignore
|
|
12
10
|
*/
|
|
13
|
-
enableLogging
|
|
11
|
+
enableLogging?: boolean;
|
|
14
12
|
/**
|
|
15
13
|
* @ignore
|
|
16
14
|
*/
|
|
17
|
-
enableDebugLogging
|
|
15
|
+
enableDebugLogging?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
webEnvReady?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export interface AgoraEnvType extends AgoraEnvOptions {
|
|
18
26
|
/**
|
|
19
27
|
* @ignore
|
|
20
28
|
*/
|
|
@@ -22,7 +30,7 @@ export interface AgoraEnvType {
|
|
|
22
30
|
/**
|
|
23
31
|
* @ignore
|
|
24
32
|
*/
|
|
25
|
-
AgoraRendererManager?:
|
|
33
|
+
AgoraRendererManager?: IRendererManager;
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
/**
|
|
@@ -169,6 +177,10 @@ export interface ShareVideoFrame {
|
|
|
169
177
|
* @ignore
|
|
170
178
|
*/
|
|
171
179
|
height: number;
|
|
180
|
+
/**
|
|
181
|
+
* @ignore
|
|
182
|
+
*/
|
|
183
|
+
yStride: number;
|
|
172
184
|
/**
|
|
173
185
|
* @ignore
|
|
174
186
|
*/
|
|
@@ -217,25 +229,10 @@ export interface Result {
|
|
|
217
229
|
callApiResult: any;
|
|
218
230
|
}
|
|
219
231
|
|
|
220
|
-
/**
|
|
221
|
-
* @ignore
|
|
222
|
-
*/
|
|
223
|
-
export enum CallBackModule {
|
|
224
|
-
/**
|
|
225
|
-
* @ignore
|
|
226
|
-
*/
|
|
227
|
-
RTC = 0,
|
|
228
|
-
MPK,
|
|
229
|
-
OBSERVER,
|
|
230
|
-
}
|
|
231
|
-
|
|
232
232
|
/**
|
|
233
233
|
* @ignore
|
|
234
234
|
*/
|
|
235
235
|
export interface AgoraElectronBridge {
|
|
236
|
-
/**
|
|
237
|
-
* @ignore
|
|
238
|
-
*/
|
|
239
236
|
OnEvent(
|
|
240
237
|
callbackName: string,
|
|
241
238
|
callback: (
|
|
@@ -258,19 +255,42 @@ export interface AgoraElectronBridge {
|
|
|
258
255
|
|
|
259
256
|
ReleaseEnv(): void;
|
|
260
257
|
|
|
258
|
+
ReleaseRenderer(): void;
|
|
259
|
+
|
|
261
260
|
EnableVideoFrameCache(config: VideoFrameCacheConfig): void;
|
|
262
261
|
|
|
263
262
|
DisableVideoFrameCache(config: VideoFrameCacheConfig): void;
|
|
264
263
|
|
|
265
264
|
GetBuffer(ptr: number, length: number): Buffer;
|
|
266
265
|
|
|
266
|
+
/**
|
|
267
|
+
* @ignore
|
|
268
|
+
*/
|
|
267
269
|
GetVideoFrame(streamInfo: ShareVideoFrame): {
|
|
268
270
|
ret: number;
|
|
271
|
+
/**
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
269
274
|
isNewFrame: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* @ignore
|
|
277
|
+
*/
|
|
270
278
|
yStride: number;
|
|
279
|
+
/**
|
|
280
|
+
* @ignore
|
|
281
|
+
*/
|
|
271
282
|
width: number;
|
|
283
|
+
/**
|
|
284
|
+
* @ignore
|
|
285
|
+
*/
|
|
272
286
|
height: number;
|
|
287
|
+
/**
|
|
288
|
+
* @ignore
|
|
289
|
+
*/
|
|
273
290
|
rotation: number;
|
|
291
|
+
/**
|
|
292
|
+
* @ignore
|
|
293
|
+
*/
|
|
274
294
|
timestamp: number;
|
|
275
295
|
};
|
|
276
296
|
|
package/ts/Utils.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { VideoSourceType } from './Private/
|
|
2
|
-
import { RenderModeType } from './Private/AgoraMediaBase';
|
|
1
|
+
import { VideoSourceType } from './Private/AgoraMediaBase';
|
|
3
2
|
import {
|
|
4
3
|
AgoraEnvType,
|
|
5
4
|
FormatRendererVideoConfig,
|
|
@@ -107,7 +106,7 @@ export const formatConfigByVideoSourceType = (
|
|
|
107
106
|
videoSourceType: VideoSourceType;
|
|
108
107
|
} => {
|
|
109
108
|
if (videoSourceType === undefined || videoSourceType === null) {
|
|
110
|
-
throw new Error(`must set videoSourceType`);
|
|
109
|
+
throw new Error(`must set videoSourceType:${videoSourceType}`);
|
|
111
110
|
}
|
|
112
111
|
let uid = originUid;
|
|
113
112
|
let channelId = originChannelId;
|
|
@@ -123,13 +122,13 @@ export const formatConfigByVideoSourceType = (
|
|
|
123
122
|
break;
|
|
124
123
|
case VideoSourceType.VideoSourceRemote:
|
|
125
124
|
if (!uid || !channelId) {
|
|
126
|
-
throw new Error(`must set uid:${uid}
|
|
125
|
+
throw new Error(`must set uid:${uid} and channelId:${channelId}`);
|
|
127
126
|
}
|
|
128
127
|
break;
|
|
129
128
|
case VideoSourceType.VideoSourceMediaPlayer:
|
|
130
129
|
channelId = '';
|
|
131
130
|
if (!uid) {
|
|
132
|
-
throw new Error(`must set
|
|
131
|
+
throw new Error(`must set mediaPlayerId:${uid}`);
|
|
133
132
|
}
|
|
134
133
|
break;
|
|
135
134
|
default:
|
|
@@ -145,10 +144,8 @@ export const getDefaultRendererVideoConfig = (
|
|
|
145
144
|
config: RendererVideoConfig
|
|
146
145
|
): FormatRendererVideoConfig => {
|
|
147
146
|
const rendererOptions = Object.assign(
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
mirror: false,
|
|
151
|
-
},
|
|
147
|
+
{},
|
|
148
|
+
AgoraEnv.AgoraRendererManager?.defaultRenderConfig?.rendererOptions,
|
|
152
149
|
config.rendererOptions
|
|
153
150
|
);
|
|
154
151
|
|
|
@@ -198,8 +195,6 @@ const agora = require('../build/Release/agora_node_ext');
|
|
|
198
195
|
export const AgoraEnv: AgoraEnvType = {
|
|
199
196
|
enableLogging: true,
|
|
200
197
|
enableDebugLogging: false,
|
|
198
|
+
webEnvReady: true,
|
|
201
199
|
AgoraElectronBridge: new agora.AgoraElectronBridge(),
|
|
202
200
|
};
|
|
203
|
-
|
|
204
|
-
// @ts-ignore
|
|
205
|
-
(window || global).AgoraEnv = AgoraEnv;
|
package/types/AgoraSdk.d.ts
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export * from './Private/
|
|
5
|
-
export * from './Private/
|
|
6
|
-
export * from './Private/
|
|
7
|
-
export * from './Private/
|
|
8
|
-
export * from './Private/
|
|
9
|
-
export * from './Private/
|
|
10
|
-
export * from './Private/
|
|
11
|
-
export * from './Private/
|
|
12
|
-
export * from './Private/
|
|
13
|
-
export * from './Private/
|
|
14
|
-
export * from './Private/
|
|
15
|
-
export * from './Private/
|
|
16
|
-
export * from './Private/
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export
|
|
1
|
+
import { IMediaPlayerCacheManager } from './Private/IAgoraMediaPlayer';
|
|
2
|
+
import { IRtcEngineEx } from './Private/IAgoraRtcEngineEx';
|
|
3
|
+
import { AgoraEnvOptions } from './Types';
|
|
4
|
+
export * from './Private/AgoraBase';
|
|
5
|
+
export * from './Private/AgoraMediaBase';
|
|
6
|
+
export * from './Private/AgoraMediaPlayerTypes';
|
|
7
|
+
export * from './Private/IAgoraLog';
|
|
8
|
+
export * from './Private/IAgoraMediaEngine';
|
|
9
|
+
export * from './Private/IAgoraMediaPlayer';
|
|
10
|
+
export * from './Private/IAgoraMediaPlayerSource';
|
|
11
|
+
export * from './Private/IAgoraMediaRecorder';
|
|
12
|
+
export * from './Private/IAgoraMusicContentCenter';
|
|
13
|
+
export * from './Private/IAgoraRhythmPlayer';
|
|
14
|
+
export * from './Private/IAgoraRtcEngine';
|
|
15
|
+
export * from './Private/IAgoraRtcEngineEx';
|
|
16
|
+
export * from './Private/IAgoraSpatialAudio';
|
|
17
|
+
export * from './Private/IAudioDeviceManager';
|
|
18
|
+
export * from './Renderer';
|
|
19
|
+
export * from './Types';
|
|
20
|
+
export * from './Utils';
|
|
21
|
+
/**
|
|
22
|
+
* Creates an IRtcEngine object.
|
|
23
|
+
* Currently, the Agora RTC SDK v4.x supports creating only one IRtcEngine object for each app.
|
|
24
|
+
*
|
|
25
|
+
* @returns
|
|
26
|
+
* One IRtcEngine object.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createAgoraRtcEngine(options?: AgoraEnvOptions): IRtcEngineEx;
|
|
29
|
+
/**
|
|
30
|
+
* Gets one IMediaPlayerCacheManager instance.
|
|
31
|
+
* When you successfully call this method, the SDK returns a media player cache manager instance. The cache manager is a singleton pattern. Therefore, multiple calls to this method returns the same instance.Make sure the IRtcEngine is initialized before you call this method.
|
|
32
|
+
*
|
|
33
|
+
* @returns
|
|
34
|
+
* The IMediaPlayerCacheManager instance.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getMediaPlayerCacheManager(): IMediaPlayerCacheManager;
|
|
37
|
+
export default createAgoraRtcEngine;
|
|
38
|
+
//# sourceMappingURL=AgoraSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgoraSdk.d.ts","sourceRoot":"","sources":["../ts/AgoraSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAIxB;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,YAAY,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,wBAAwB,CAErE;AAED,eAAe,oBAAoB,CAAC"}
|