agora-electron-sdk 0.0.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 +315 -0
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/gulpfile.js +52 -0
- package/js/AgoraSdk.js +64 -0
- package/js/Decoder/gpu-utils.js +74 -0
- package/js/Decoder/index.js +172 -0
- package/js/Private/AgoraBase.js +3985 -0
- package/js/Private/AgoraMediaBase.js +1014 -0
- package/js/Private/AgoraMediaPlayerTypes.js +316 -0
- package/js/Private/IAgoraH265Transcoder.js +36 -0
- package/js/Private/IAgoraLog.js +78 -0
- package/js/Private/IAgoraMediaEngine.js +32 -0
- package/js/Private/IAgoraMediaPlayer.js +16 -0
- package/js/Private/IAgoraMediaPlayerSource.js +3 -0
- package/js/Private/IAgoraMediaRecorder.js +10 -0
- package/js/Private/IAgoraMediaStreamingSource.js +74 -0
- package/js/Private/IAgoraMusicContentCenter.js +157 -0
- package/js/Private/IAgoraRhythmPlayer.js +62 -0
- package/js/Private/IAgoraRtcEngine.js +982 -0
- package/js/Private/IAgoraRtcEngineEx.js +19 -0
- package/js/Private/IAgoraSpatialAudio.js +24 -0
- package/js/Private/IAudioDeviceManager.js +20 -0
- package/js/Private/extension/AgoraBaseExtension.js +3 -0
- package/js/Private/extension/AgoraMediaBaseExtension.js +2 -0
- package/js/Private/extension/AgoraMediaPlayerTypesExtension.js +2 -0
- package/js/Private/extension/IAgoraH265TranscoderExtension.js +2 -0
- package/js/Private/extension/IAgoraLogExtension.js +2 -0
- package/js/Private/extension/IAgoraMediaEngineExtension.js +2 -0
- package/js/Private/extension/IAgoraMediaPlayerExtension.js +2 -0
- package/js/Private/extension/IAgoraMediaPlayerSourceExtension.js +2 -0
- package/js/Private/extension/IAgoraMediaRecorderExtension.js +2 -0
- package/js/Private/extension/IAgoraMusicContentCenterExtension.js +2 -0
- package/js/Private/extension/IAgoraRhythmPlayerExtension.js +2 -0
- package/js/Private/extension/IAgoraRtcEngineExExtension.js +2 -0
- package/js/Private/extension/IAgoraRtcEngineExtension.js +2 -0
- package/js/Private/extension/IAgoraSpatialAudioExtension.js +2 -0
- package/js/Private/extension/IAudioDeviceManagerExtension.js +2 -0
- package/js/Private/impl/AgoraBaseImpl.js +23 -0
- package/js/Private/impl/AgoraMediaBaseImpl.js +149 -0
- package/js/Private/impl/IAgoraH265TranscoderImpl.js +116 -0
- package/js/Private/impl/IAgoraMediaEngineImpl.js +337 -0
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +950 -0
- package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +73 -0
- package/js/Private/impl/IAgoraMediaRecorderImpl.js +47 -0
- package/js/Private/impl/IAgoraMusicContentCenterImpl.js +422 -0
- package/js/Private/impl/IAgoraRtcEngineExImpl.js +1042 -0
- package/js/Private/impl/IAgoraRtcEngineImpl.js +5167 -0
- package/js/Private/impl/IAgoraSpatialAudioImpl.js +358 -0
- package/js/Private/impl/IAudioDeviceManagerImpl.js +375 -0
- package/js/Private/internal/AgoraH265TranscoderInternal.js +62 -0
- package/js/Private/internal/AgoraMediaBaseInternal.js +15 -0
- package/js/Private/internal/AudioDeviceManagerInternal.js +44 -0
- package/js/Private/internal/IrisApiEngine.js +424 -0
- package/js/Private/internal/LocalSpatialAudioEngineInternal.js +7 -0
- package/js/Private/internal/MediaEngineInternal.js +122 -0
- package/js/Private/internal/MediaPlayerInternal.js +194 -0
- package/js/Private/internal/MediaRecorderInternal.js +70 -0
- package/js/Private/internal/MusicContentCenterInternal.js +139 -0
- package/js/Private/internal/RtcEngineExInternal.js +430 -0
- package/js/Private/ipc/main.js +21 -0
- package/js/Private/ipc/renderer.js +21 -0
- package/js/Private/ti/AgoraBase-ti.js +40 -0
- package/js/Private/ti/AgoraMediaBase-ti.js +75 -0
- package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +5 -0
- package/js/Private/ti/IAgoraH265Transcoder-ti.js +40 -0
- package/js/Private/ti/IAgoraLog-ti.js +5 -0
- package/js/Private/ti/IAgoraMediaEngine-ti.js +5 -0
- package/js/Private/ti/IAgoraMediaPlayer-ti.js +38 -0
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +50 -0
- package/js/Private/ti/IAgoraMediaRecorder-ti.js +5 -0
- package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +5 -0
- package/js/Private/ti/IAgoraMusicContentCenter-ti.js +42 -0
- package/js/Private/ti/IAgoraRhythmPlayer-ti.js +5 -0
- package/js/Private/ti/IAgoraRtcEngine-ti.js +141 -0
- package/js/Private/ti/IAgoraRtcEngineEx-ti.js +5 -0
- package/js/Private/ti/IAgoraSpatialAudio-ti.js +5 -0
- package/js/Private/ti/IAudioDeviceManager-ti.js +5 -0
- package/js/Renderer/AgoraView.js +161 -0
- package/js/Renderer/CapabilityManager.js +99 -0
- package/js/Renderer/IRenderer.js +136 -0
- package/js/Renderer/IRendererCache.js +75 -0
- package/js/Renderer/RendererCache.js +100 -0
- package/js/Renderer/RendererManager.js +301 -0
- package/js/Renderer/WebCodecsRenderer/index.js +109 -0
- package/js/Renderer/WebCodecsRendererCache.js +115 -0
- package/js/Renderer/WebGLRenderer/index.js +314 -0
- package/js/Renderer/WebGLRenderer/webgl-utils.js +1337 -0
- package/js/Renderer/YUVCanvasRenderer/index.js +46 -0
- package/js/Renderer/index.js +17 -0
- package/js/Types.js +67 -0
- package/js/Utils.js +187 -0
- package/package.json +167 -0
- package/scripts/bootstrap.js +29 -0
- package/scripts/build.js +37 -0
- package/scripts/buildJS.js +14 -0
- package/scripts/checkElectron.js +43 -0
- package/scripts/clean.js +16 -0
- package/scripts/download.js +105 -0
- package/scripts/downloadPrebuild.js +199 -0
- package/scripts/getConfig.js +73 -0
- package/scripts/logger.js +32 -0
- package/scripts/synclib.js +69 -0
- package/scripts/util.js +47 -0
- package/scripts/zipBuild.js +40 -0
- package/ts/AgoraSdk.ts +54 -0
- package/ts/Decoder/gpu-utils.ts +92 -0
- package/ts/Decoder/index.ts +206 -0
- package/ts/Private/AgoraBase.ts +5511 -0
- package/ts/Private/AgoraMediaBase.ts +1764 -0
- package/ts/Private/AgoraMediaPlayerTypes.ts +464 -0
- package/ts/Private/IAgoraH265Transcoder.ts +73 -0
- package/ts/Private/IAgoraLog.ts +91 -0
- package/ts/Private/IAgoraMediaEngine.ts +316 -0
- package/ts/Private/IAgoraMediaPlayer.ts +744 -0
- package/ts/Private/IAgoraMediaPlayerSource.ts +137 -0
- package/ts/Private/IAgoraMediaRecorder.ts +25 -0
- package/ts/Private/IAgoraMediaStreamingSource.ts +81 -0
- package/ts/Private/IAgoraMusicContentCenter.ts +455 -0
- package/ts/Private/IAgoraRhythmPlayer.ts +67 -0
- package/ts/Private/IAgoraRtcEngine.ts +7306 -0
- package/ts/Private/IAgoraRtcEngineEx.ts +992 -0
- package/ts/Private/IAgoraSpatialAudio.ts +250 -0
- package/ts/Private/IAudioDeviceManager.ts +342 -0
- package/ts/Private/extension/AgoraBaseExtension.ts +14 -0
- package/ts/Private/extension/AgoraMediaBaseExtension.ts +1 -0
- package/ts/Private/extension/AgoraMediaPlayerTypesExtension.ts +1 -0
- package/ts/Private/extension/IAgoraH265TranscoderExtension.ts +39 -0
- package/ts/Private/extension/IAgoraLogExtension.ts +1 -0
- package/ts/Private/extension/IAgoraMediaEngineExtension.ts +62 -0
- package/ts/Private/extension/IAgoraMediaPlayerExtension.ts +64 -0
- package/ts/Private/extension/IAgoraMediaPlayerSourceExtension.ts +1 -0
- package/ts/Private/extension/IAgoraMediaRecorderExtension.ts +59 -0
- package/ts/Private/extension/IAgoraMusicContentCenterExtension.ts +34 -0
- package/ts/Private/extension/IAgoraRhythmPlayerExtension.ts +1 -0
- package/ts/Private/extension/IAgoraRtcEngineExExtension.ts +1 -0
- package/ts/Private/extension/IAgoraRtcEngineExtension.ts +64 -0
- package/ts/Private/extension/IAgoraSpatialAudioExtension.ts +1 -0
- package/ts/Private/extension/IAudioDeviceManagerExtension.ts +1 -0
- package/ts/Private/impl/AgoraBaseImpl.ts +39 -0
- package/ts/Private/impl/AgoraMediaBaseImpl.ts +237 -0
- package/ts/Private/impl/IAgoraH265TranscoderImpl.ts +152 -0
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +491 -0
- package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +1169 -0
- package/ts/Private/impl/IAgoraMediaPlayerSourceImpl.ts +94 -0
- package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +59 -0
- package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +562 -0
- package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +1672 -0
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +7352 -0
- package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +495 -0
- package/ts/Private/impl/IAudioDeviceManagerImpl.ts +443 -0
- package/ts/Private/internal/AgoraH265TranscoderInternal.ts +97 -0
- package/ts/Private/internal/AgoraMediaBaseInternal.ts +15 -0
- package/ts/Private/internal/AudioDeviceManagerInternal.ts +46 -0
- package/ts/Private/internal/IrisApiEngine.ts +598 -0
- package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +3 -0
- package/ts/Private/internal/MediaEngineInternal.ts +190 -0
- package/ts/Private/internal/MediaPlayerInternal.ts +311 -0
- package/ts/Private/internal/MediaRecorderInternal.ts +100 -0
- package/ts/Private/internal/MusicContentCenterInternal.ts +208 -0
- package/ts/Private/internal/RtcEngineExInternal.ts +647 -0
- package/ts/Private/ipc/main.ts +22 -0
- package/ts/Private/ipc/renderer.ts +21 -0
- package/ts/Private/ti/AgoraBase-ti.ts +16 -0
- package/ts/Private/ti/AgoraMediaBase-ti.ts +58 -0
- package/ts/Private/ti/AgoraMediaPlayerTypes-ti.ts +11 -0
- package/ts/Private/ti/IAgoraH265Transcoder-ti.ts +16 -0
- package/ts/Private/ti/IAgoraLog-ti.ts +11 -0
- package/ts/Private/ti/IAgoraMediaEngine-ti.ts +11 -0
- package/ts/Private/ti/IAgoraMediaPlayer-ti.ts +14 -0
- package/ts/Private/ti/IAgoraMediaPlayerSource-ti.ts +26 -0
- package/ts/Private/ti/IAgoraMediaRecorder-ti.ts +11 -0
- package/ts/Private/ti/IAgoraMediaStreamingSource-ti.ts +11 -0
- package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +18 -0
- package/ts/Private/ti/IAgoraRhythmPlayer-ti.ts +11 -0
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +119 -0
- package/ts/Private/ti/IAgoraRtcEngineEx-ti.ts +11 -0
- package/ts/Private/ti/IAgoraSpatialAudio-ti.ts +11 -0
- package/ts/Private/ti/IAudioDeviceManager-ti.ts +11 -0
- package/ts/Renderer/AgoraView.ts +235 -0
- package/ts/Renderer/CapabilityManager.ts +126 -0
- package/ts/Renderer/IRenderer.ts +158 -0
- package/ts/Renderer/IRendererCache.ts +96 -0
- package/ts/Renderer/RendererCache.ts +124 -0
- package/ts/Renderer/RendererManager.ts +400 -0
- package/ts/Renderer/WebCodecsRenderer/index.ts +145 -0
- package/ts/Renderer/WebCodecsRendererCache.ts +137 -0
- package/ts/Renderer/WebGLRenderer/index.ts +489 -0
- package/ts/Renderer/WebGLRenderer/webgl-utils.js +1510 -0
- package/ts/Renderer/YUVCanvasRenderer/index.ts +67 -0
- package/ts/Renderer/index.ts +1 -0
- package/ts/Types.ts +249 -0
- package/ts/Utils.ts +197 -0
- package/types/AgoraSdk.d.ts +40 -0
- package/types/AgoraSdk.d.ts.map +1 -0
- package/types/Decoder/gpu-utils.d.ts +21 -0
- package/types/Decoder/gpu-utils.d.ts.map +1 -0
- package/types/Decoder/index.d.ts +26 -0
- package/types/Decoder/index.d.ts.map +1 -0
- package/types/Private/AgoraBase.d.ts +5310 -0
- package/types/Private/AgoraBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaBase.d.ts +1668 -0
- package/types/Private/AgoraMediaBase.d.ts.map +1 -0
- package/types/Private/AgoraMediaPlayerTypes.d.ts +453 -0
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -0
- package/types/Private/IAgoraH265Transcoder.d.ts +28 -0
- package/types/Private/IAgoraH265Transcoder.d.ts.map +1 -0
- package/types/Private/IAgoraLog.d.ts +89 -0
- package/types/Private/IAgoraLog.d.ts.map +1 -0
- package/types/Private/IAgoraMediaEngine.d.ts +250 -0
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayer.d.ts +648 -0
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraMediaPlayerSource.d.ts +109 -0
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -0
- package/types/Private/IAgoraMediaRecorder.d.ts +20 -0
- 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 +381 -0
- package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -0
- package/types/Private/IAgoraRhythmPlayer.d.ts +65 -0
- package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngine.d.ts +6103 -0
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -0
- package/types/Private/IAgoraRtcEngineEx.d.ts +741 -0
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -0
- package/types/Private/IAgoraSpatialAudio.d.ts +196 -0
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -0
- package/types/Private/IAudioDeviceManager.d.ts +312 -0
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -0
- package/types/Private/extension/AgoraBaseExtension.d.ts +14 -0
- package/types/Private/extension/AgoraBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts +2 -0
- package/types/Private/extension/AgoraMediaBaseExtension.d.ts.map +1 -0
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +2 -0
- package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts +24 -0
- package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraLogExtension.d.ts +2 -0
- package/types/Private/extension/IAgoraLogExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +40 -0
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts +46 -0
- package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +2 -0
- package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts +44 -0
- package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts +20 -0
- package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts +2 -0
- package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts +2 -0
- package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts +42 -0
- package/types/Private/extension/IAgoraRtcEngineExtension.d.ts.map +1 -0
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts +2 -0
- package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts.map +1 -0
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts +2 -0
- package/types/Private/extension/IAudioDeviceManagerExtension.d.ts.map +1 -0
- package/types/Private/impl/AgoraBaseImpl.d.ts +3 -0
- package/types/Private/impl/AgoraBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts +14 -0
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts +15 -0
- package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +46 -0
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +143 -0
- package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +3 -0
- package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts +11 -0
- package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +67 -0
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +116 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +628 -0
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -0
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +47 -0
- package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -0
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts +65 -0
- package/types/Private/impl/IAudioDeviceManagerImpl.d.ts.map +1 -0
- 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/AudioDeviceManagerInternal.d.ts +9 -0
- package/types/Private/internal/AudioDeviceManagerInternal.d.ts.map +1 -0
- package/types/Private/internal/IrisApiEngine.d.ts +69 -0
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -0
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +4 -0
- package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaEngineInternal.d.ts +23 -0
- package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaPlayerInternal.d.ts +30 -0
- package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -0
- package/types/Private/internal/MediaRecorderInternal.d.ts +16 -0
- package/types/Private/internal/MediaRecorderInternal.d.ts.map +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts +31 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -0
- package/types/Private/internal/RtcEngineExInternal.d.ts +73 -0
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -0
- package/types/Private/ipc/main.d.ts +2 -0
- package/types/Private/ipc/main.d.ts.map +1 -0
- package/types/Private/ipc/renderer.d.ts +3 -0
- package/types/Private/ipc/renderer.d.ts.map +1 -0
- package/types/Private/ti/AgoraBase-ti.d.ts +8 -0
- package/types/Private/ti/AgoraBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts +15 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -0
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +7 -0
- package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts.map +1 -0
- 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/IAgoraLog-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraLog-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraMediaEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts +8 -0
- package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +8 -0
- package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts +8 -0
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts +10 -0
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts.map +1 -0
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts +7 -0
- package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts.map +1 -0
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts +7 -0
- package/types/Private/ti/IAudioDeviceManager-ti.d.ts.map +1 -0
- package/types/Renderer/AgoraView.d.ts +76 -0
- package/types/Renderer/AgoraView.d.ts.map +1 -0
- package/types/Renderer/CapabilityManager.d.ts +20 -0
- package/types/Renderer/CapabilityManager.d.ts.map +1 -0
- package/types/Renderer/IRenderer.d.ts +20 -0
- package/types/Renderer/IRenderer.d.ts.map +1 -0
- package/types/Renderer/IRendererCache.d.ts +26 -0
- package/types/Renderer/IRendererCache.d.ts.map +1 -0
- package/types/Renderer/RendererCache.d.ts +24 -0
- package/types/Renderer/RendererCache.d.ts.map +1 -0
- package/types/Renderer/RendererManager.d.ts +66 -0
- package/types/Renderer/RendererManager.d.ts.map +1 -0
- package/types/Renderer/WebCodecsRenderer/index.d.ts +14 -0
- package/types/Renderer/WebCodecsRenderer/index.d.ts.map +1 -0
- package/types/Renderer/WebCodecsRendererCache.d.ts +15 -0
- package/types/Renderer/WebCodecsRendererCache.d.ts.map +1 -0
- package/types/Renderer/WebGLRenderer/index.d.ts +27 -0
- 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 +9 -0
- package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -0
- package/types/Renderer/index.d.ts +2 -0
- package/types/Renderer/index.d.ts.map +1 -0
- package/types/Types.d.ts +177 -0
- package/types/Types.d.ts.map +1 -0
- package/types/Utils.d.ts +50 -0
- package/types/Utils.d.ts.map +1 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { URL } = require('url');
|
|
5
|
+
|
|
6
|
+
const archiveType = require('archive-type');
|
|
7
|
+
const contentDisposition = require('content-disposition');
|
|
8
|
+
const decompress = require('decompress');
|
|
9
|
+
const extName = require('ext-name');
|
|
10
|
+
const fileType = require('file-type');
|
|
11
|
+
const filenamify = require('filenamify');
|
|
12
|
+
const getStream = require('get-stream');
|
|
13
|
+
const got = require('got');
|
|
14
|
+
const pEvent = require('p-event');
|
|
15
|
+
const pify = require('pify');
|
|
16
|
+
|
|
17
|
+
const fsP = pify(fs);
|
|
18
|
+
const filenameFromPath = (res) =>
|
|
19
|
+
path.basename(new URL(res.requestUrl).pathname);
|
|
20
|
+
|
|
21
|
+
const getExtFromMime = (res) => {
|
|
22
|
+
const header = res.headers['content-type'];
|
|
23
|
+
|
|
24
|
+
if (!header) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const exts = extName.mime(header);
|
|
29
|
+
|
|
30
|
+
if (exts.length !== 1) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return exts[0].ext;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const getFilename = (res, data) => {
|
|
38
|
+
const header = res.headers['content-disposition'];
|
|
39
|
+
|
|
40
|
+
if (header) {
|
|
41
|
+
const parsed = contentDisposition.parse(header);
|
|
42
|
+
|
|
43
|
+
if (parsed.parameters && parsed.parameters.filename) {
|
|
44
|
+
return parsed.parameters.filename;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let filename = filenameFromPath(res);
|
|
49
|
+
|
|
50
|
+
if (!path.extname(filename)) {
|
|
51
|
+
const ext = (fileType(data) || {}).ext || getExtFromMime(res);
|
|
52
|
+
|
|
53
|
+
if (ext) {
|
|
54
|
+
filename = `${filename}.${ext}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return filename;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
module.exports = (uri, output, opts) => {
|
|
62
|
+
opts = {
|
|
63
|
+
...opts,
|
|
64
|
+
encoding: null,
|
|
65
|
+
responseType: 'buffer',
|
|
66
|
+
rejectUnauthorized: process.env.npm_config_strict_ssl !== 'false',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const stream = got.stream(uri);
|
|
70
|
+
|
|
71
|
+
const promise = pEvent(stream, 'response')
|
|
72
|
+
.then((res) => {
|
|
73
|
+
const encoding = opts.encoding === null ? 'buffer' : opts.encoding;
|
|
74
|
+
return Promise.all([getStream(stream, { encoding }), res]);
|
|
75
|
+
})
|
|
76
|
+
.then((result) => {
|
|
77
|
+
const [data, res] = result;
|
|
78
|
+
|
|
79
|
+
if (!output) {
|
|
80
|
+
return opts.extract && archiveType(data)
|
|
81
|
+
? decompress(data, opts)
|
|
82
|
+
: data;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const filename = opts.filename || filenamify(getFilename(res, data));
|
|
86
|
+
const outputFilepath = path.join(output, filename);
|
|
87
|
+
|
|
88
|
+
if (opts.extract && archiveType(data)) {
|
|
89
|
+
return decompress(data, path.dirname(outputFilepath), opts);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
import('make-dir').then((module) => {
|
|
93
|
+
const { makeDirectory } = module;
|
|
94
|
+
|
|
95
|
+
return makeDirectory(path.dirname(outputFilepath))
|
|
96
|
+
.then(() => fsP.writeFile(outputFilepath, data))
|
|
97
|
+
.then(() => data);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
stream.then = promise.then.bind(promise);
|
|
102
|
+
stream.catch = promise.catch.bind(promise);
|
|
103
|
+
|
|
104
|
+
return stream;
|
|
105
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
|
|
5
|
+
const { cleanDir, buildDir } = require('./clean');
|
|
6
|
+
const download = require('./download');
|
|
7
|
+
|
|
8
|
+
const getConfig = require('./getConfig');
|
|
9
|
+
const logger = require('./logger');
|
|
10
|
+
const { getOS } = require('./util');
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
platform,
|
|
14
|
+
packageVersion,
|
|
15
|
+
arch,
|
|
16
|
+
no_symbol,
|
|
17
|
+
native_sdk_mac,
|
|
18
|
+
native_sdk_win,
|
|
19
|
+
} = getConfig();
|
|
20
|
+
|
|
21
|
+
const workspaceDir = `${path.join(__dirname, '..')}`;
|
|
22
|
+
|
|
23
|
+
const normalizePath = (filePath) => filePath.split(path.sep).join('/');
|
|
24
|
+
|
|
25
|
+
const getDownloadURL = () => {
|
|
26
|
+
let downloadUrl = `https://download.agora.io/sdk/release/Electron-${getOS()}-${packageVersion}-napi.zip`;
|
|
27
|
+
if (platform === 'win32' && arch === 'x64') {
|
|
28
|
+
downloadUrl = `https://download.agora.io/sdk/release/Electron-win64-${packageVersion}-napi.zip`;
|
|
29
|
+
}
|
|
30
|
+
return downloadUrl;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// If native_stk_url is not defined in app/packaging.json,
|
|
34
|
+
// it will be read from agora-electron-sdk/packaging.json
|
|
35
|
+
const getNativeDownloadURL = () => {
|
|
36
|
+
let downloadUrl = '';
|
|
37
|
+
if (platform === 'win32') {
|
|
38
|
+
downloadUrl = native_sdk_win;
|
|
39
|
+
} else if (platform === 'darwin') {
|
|
40
|
+
downloadUrl = native_sdk_mac;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!downloadUrl) {
|
|
44
|
+
const {
|
|
45
|
+
agora_electron: { native_sdk_win, native_sdk_mac },
|
|
46
|
+
} = require('../package.json');
|
|
47
|
+
if (platform === 'win32') {
|
|
48
|
+
downloadUrl = native_sdk_win;
|
|
49
|
+
} else if (platform === 'darwin') {
|
|
50
|
+
downloadUrl = native_sdk_mac;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return downloadUrl;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const matchNativeFile = (path) => {
|
|
58
|
+
let result = false;
|
|
59
|
+
switch (platform) {
|
|
60
|
+
case 'win32':
|
|
61
|
+
switch (arch) {
|
|
62
|
+
case 'ia32':
|
|
63
|
+
result = path.startsWith('sdk/x86/') && path.endsWith('.dll');
|
|
64
|
+
break;
|
|
65
|
+
case 'x64':
|
|
66
|
+
result = path.startsWith('sdk/x86_64/') && path.endsWith('.dll');
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case 'darwin':
|
|
71
|
+
result =
|
|
72
|
+
path.startsWith('libs') &&
|
|
73
|
+
/^libs\/.*\.xcframework\/macos-arm64_x86_64\//.test(path);
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const macNoSymbolList = [
|
|
80
|
+
'./build/Release/obj.target',
|
|
81
|
+
'./build/Api',
|
|
82
|
+
'./build/Renderer',
|
|
83
|
+
'./build/Utils',
|
|
84
|
+
'./build/agora_node_ext.target.mk',
|
|
85
|
+
'./build/AgoraSdk.js',
|
|
86
|
+
'./build/binding.Makefile',
|
|
87
|
+
'./build/config.gypi',
|
|
88
|
+
'./build/gyp-mac-tool',
|
|
89
|
+
'./build/Makefile',
|
|
90
|
+
'./build/VideoSource.target.mk',
|
|
91
|
+
'./build/Release/agora_node_ext.node.dSYM',
|
|
92
|
+
'./build/Release/VideoSource.dSYM',
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const winNoSymbolList = [
|
|
96
|
+
'./build/Release/obj',
|
|
97
|
+
'./build/Api',
|
|
98
|
+
'./build/Renderer',
|
|
99
|
+
'./build/Utils',
|
|
100
|
+
'./build/agora_node_ext.vcxproj',
|
|
101
|
+
'./build/agora_node_ext.vcxproj.filters',
|
|
102
|
+
'./build/binding.sln',
|
|
103
|
+
'./build/config.gypi',
|
|
104
|
+
'./build/VideoSource.vcxproj',
|
|
105
|
+
'./build/VideoSource.vcxproj.filters',
|
|
106
|
+
'./build/AgoraSdk.js',
|
|
107
|
+
'./build/Release/agora_node_ext.exp',
|
|
108
|
+
'./build/Release/agora_node_ext.iobj',
|
|
109
|
+
'./build/Release/agora_node_ext.ipdb',
|
|
110
|
+
'./build/Release/agora_node_ext.pdb',
|
|
111
|
+
'./build/Release/VideoSource.iobj',
|
|
112
|
+
'./build/Release/VideoSource.ipdb',
|
|
113
|
+
'./build/Release/VideoSource.pdb',
|
|
114
|
+
'./build/Release/agora_node_ext.ilk',
|
|
115
|
+
'./build/Release/VideoSource.ilk',
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
const removeFileByFilter = async () => {
|
|
119
|
+
const filterList = platform === 'darwin' ? macNoSymbolList : winNoSymbolList;
|
|
120
|
+
|
|
121
|
+
for (const iterator of filterList) {
|
|
122
|
+
const filePath = `${path.join(workspaceDir, iterator)}`;
|
|
123
|
+
await fs.remove(filePath);
|
|
124
|
+
}
|
|
125
|
+
logger.info('Success: Download and cleanup finished');
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
module.exports = async () => {
|
|
129
|
+
await cleanDir(buildDir);
|
|
130
|
+
|
|
131
|
+
const downloadUrl = getDownloadURL();
|
|
132
|
+
const nativeDownloadURL = getNativeDownloadURL();
|
|
133
|
+
|
|
134
|
+
/** start download */
|
|
135
|
+
logger.info('Package Version: %s', packageVersion);
|
|
136
|
+
logger.info('Platform: %s', platform);
|
|
137
|
+
if (arch) logger.info('Arch: %s', arch);
|
|
138
|
+
logger.info('Download URL %s ', downloadUrl);
|
|
139
|
+
|
|
140
|
+
logger.info('Downloading prebuilt C++ addon for Agora Electron SDK...');
|
|
141
|
+
await download(downloadUrl, buildDir, {
|
|
142
|
+
strip: 1,
|
|
143
|
+
extract: true,
|
|
144
|
+
filter: (file) => {
|
|
145
|
+
return (
|
|
146
|
+
file.type !== 'directory' &&
|
|
147
|
+
!file.path.endsWith(path.sep) &&
|
|
148
|
+
file.data.length !== 0
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (nativeDownloadURL) {
|
|
154
|
+
logger.info('Native SDK URL %s ', nativeDownloadURL);
|
|
155
|
+
logger.info('Downloading native SDK for Agora Electron SDK...');
|
|
156
|
+
const nativeLibDir = path.resolve(__dirname, `${buildDir}/Release`);
|
|
157
|
+
await download(nativeDownloadURL, nativeLibDir, {
|
|
158
|
+
strip: 1,
|
|
159
|
+
extract: true,
|
|
160
|
+
filter: (file) => {
|
|
161
|
+
file.path = normalizePath(file.path);
|
|
162
|
+
if (matchNativeFile(file.path)) {
|
|
163
|
+
if (file.type === 'file' && file.path.endsWith('/')) {
|
|
164
|
+
file.type = 'directory';
|
|
165
|
+
}
|
|
166
|
+
switch (platform) {
|
|
167
|
+
case 'win32':
|
|
168
|
+
switch (arch) {
|
|
169
|
+
case 'ia32':
|
|
170
|
+
file.path = file.path.replace(/^sdk\/x86\//, '');
|
|
171
|
+
break;
|
|
172
|
+
case 'x64':
|
|
173
|
+
file.path = file.path.replace(/^sdk\/x86_64\//, '');
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
case 'darwin':
|
|
178
|
+
file.path = file.path.replace(
|
|
179
|
+
/^libs\/.*\.xcframework\/macos-arm64_x86_64\//,
|
|
180
|
+
''
|
|
181
|
+
);
|
|
182
|
+
if (fs.exists(`${nativeLibDir}/${file.path}`)) {
|
|
183
|
+
fs.remove(`${nativeLibDir}/${file.path}`);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
logger.info(`move native file: ${file.path} → ${nativeLibDir}`);
|
|
188
|
+
return true;
|
|
189
|
+
} else {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (no_symbol) {
|
|
197
|
+
await removeFileByFilter();
|
|
198
|
+
}
|
|
199
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const minimist = require('minimist');
|
|
4
|
+
|
|
5
|
+
const logger = require('./logger');
|
|
6
|
+
|
|
7
|
+
const { INIT_CWD } = minimist(process.argv.slice(2), {
|
|
8
|
+
string: ['INIT_CWD'],
|
|
9
|
+
default: {},
|
|
10
|
+
});
|
|
11
|
+
logger.info(`pass INIT_CWD ${INIT_CWD}`);
|
|
12
|
+
logger.info(`process.env.INIT_CWD ${process.env.INIT_CWD}`);
|
|
13
|
+
|
|
14
|
+
const getArgvFromPkgJson = () => {
|
|
15
|
+
const projectDir = path.join(INIT_CWD, 'package.json');
|
|
16
|
+
const { agora_electron = {} } = require(projectDir);
|
|
17
|
+
const { version } = require(path.join(process.env.INIT_CWD, 'package.json'));
|
|
18
|
+
const {
|
|
19
|
+
prebuilt = true,
|
|
20
|
+
platform = process.platform,
|
|
21
|
+
debug = false,
|
|
22
|
+
silent = false,
|
|
23
|
+
arch = process.arch,
|
|
24
|
+
no_symbol = true,
|
|
25
|
+
} = agora_electron;
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
...agora_electron,
|
|
29
|
+
packageVersion: version,
|
|
30
|
+
platform,
|
|
31
|
+
prebuilt: !!prebuilt,
|
|
32
|
+
debug: !!debug,
|
|
33
|
+
silent: !!silent,
|
|
34
|
+
arch,
|
|
35
|
+
no_symbol,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getConfig = () => {
|
|
40
|
+
const {
|
|
41
|
+
argv,
|
|
42
|
+
env: {
|
|
43
|
+
npm_config_agora_electron_sdk_pre_built,
|
|
44
|
+
npm_config_agora_electron_sdk_platform,
|
|
45
|
+
npm_config_agora_electron_sdk_arch,
|
|
46
|
+
},
|
|
47
|
+
} = process;
|
|
48
|
+
|
|
49
|
+
let config = minimist(argv.slice(2), {
|
|
50
|
+
boolean: ['prebuilt', 'debug', 'silent', 'no_symbol'],
|
|
51
|
+
string: ['arch', 'platform'],
|
|
52
|
+
default: { ...getArgvFromPkgJson() },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
logger.info(
|
|
56
|
+
`env: ${npm_config_agora_electron_sdk_pre_built} ${npm_config_agora_electron_sdk_platform} ${npm_config_agora_electron_sdk_arch}`
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// argv from ci/npm_config
|
|
60
|
+
if (npm_config_agora_electron_sdk_pre_built !== undefined) {
|
|
61
|
+
config.prebuilt = !!+npm_config_agora_electron_sdk_pre_built;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (npm_config_agora_electron_sdk_platform !== undefined) {
|
|
65
|
+
config.platform = npm_config_agora_electron_sdk_platform;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (npm_config_agora_electron_sdk_arch !== undefined) {
|
|
69
|
+
config.arch = npm_config_agora_electron_sdk_arch;
|
|
70
|
+
}
|
|
71
|
+
return config;
|
|
72
|
+
};
|
|
73
|
+
module.exports = getConfig;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const { createLogger, format, transports } = require('winston');
|
|
2
|
+
|
|
3
|
+
const myFormat = format.printf(({ level, message, label, timestamp }) => {
|
|
4
|
+
return `${timestamp} [${label}] ${level}: ${message}`;
|
|
5
|
+
});
|
|
6
|
+
const formatList = [
|
|
7
|
+
format.label({ label: 'agora-script' }),
|
|
8
|
+
format.timestamp({
|
|
9
|
+
format: 'HH:mm:ss',
|
|
10
|
+
}),
|
|
11
|
+
format.errors({ stack: true }),
|
|
12
|
+
format.splat(),
|
|
13
|
+
myFormat,
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const logger = createLogger({
|
|
17
|
+
level: 'silly',
|
|
18
|
+
format: format.combine(...formatList),
|
|
19
|
+
defaultMeta: { service: 'agora-electron-sdk-log' },
|
|
20
|
+
transports: [
|
|
21
|
+
// - Write to all logs with level `info` and below to `quick-start-combined.log`.
|
|
22
|
+
new transports.File({ filename: 'agora-electron-sdk-script.log' }),
|
|
23
|
+
],
|
|
24
|
+
silent: false,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
logger.add(
|
|
28
|
+
new transports.Console({
|
|
29
|
+
format: format.combine(...[format.colorize(), ...formatList]),
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
module.exports = logger;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const { destIrisSDKDir, cleanDir, destNativeSDKDir } = require('./clean');
|
|
4
|
+
const download = require('./download');
|
|
5
|
+
|
|
6
|
+
const getConfig = require('./getConfig');
|
|
7
|
+
const logger = require('./logger');
|
|
8
|
+
const { getOS, moveFile, getIrisStandAlone } = require('./util');
|
|
9
|
+
|
|
10
|
+
const config = getConfig();
|
|
11
|
+
|
|
12
|
+
const { iris_sdk_mac, iris_sdk_win, native_sdk_mac, native_sdk_win } = config;
|
|
13
|
+
|
|
14
|
+
const downloadSDK = async ({
|
|
15
|
+
preHook,
|
|
16
|
+
postHook,
|
|
17
|
+
sdkURL,
|
|
18
|
+
destDir,
|
|
19
|
+
strip = 1,
|
|
20
|
+
}) => {
|
|
21
|
+
logger.info(`Downloading:${sdkURL}`);
|
|
22
|
+
await preHook();
|
|
23
|
+
await download(sdkURL, destDir, {
|
|
24
|
+
strip: strip,
|
|
25
|
+
extract: true,
|
|
26
|
+
//https://github.com/kevva/decompress/issues/68
|
|
27
|
+
map: (file) => {
|
|
28
|
+
if (file.type === 'file' && file.path.endsWith('/')) {
|
|
29
|
+
file.type = 'directory';
|
|
30
|
+
}
|
|
31
|
+
return file;
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
logger.info(`Finish download:${sdkURL}`);
|
|
35
|
+
typeof postHook === 'function' && (await postHook());
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const syncLib = async (cb) => {
|
|
39
|
+
const os = getOS();
|
|
40
|
+
let irisStandAlone = getIrisStandAlone();
|
|
41
|
+
await downloadSDK({
|
|
42
|
+
preHook: () => {
|
|
43
|
+
cleanDir(destIrisSDKDir);
|
|
44
|
+
},
|
|
45
|
+
postHook: () => {
|
|
46
|
+
if (irisStandAlone) {
|
|
47
|
+
cleanDir(destNativeSDKDir);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
sdkURL: os === 'mac' ? iris_sdk_mac : iris_sdk_win,
|
|
51
|
+
destDir: destIrisSDKDir,
|
|
52
|
+
});
|
|
53
|
+
if (irisStandAlone) {
|
|
54
|
+
await downloadSDK({
|
|
55
|
+
preHook: () => {
|
|
56
|
+
cleanDir(destNativeSDKDir);
|
|
57
|
+
},
|
|
58
|
+
strip: 0,
|
|
59
|
+
sdkURL: os === 'mac' ? native_sdk_mac : native_sdk_win,
|
|
60
|
+
destDir: destNativeSDKDir,
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
moveFile(path.join(destIrisSDKDir, `../iris/DCG`), destNativeSDKDir);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
cb();
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
module.exports = syncLib;
|
package/scripts/util.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
|
|
5
|
+
const getConfig = require('./getConfig');
|
|
6
|
+
const logger = require('./logger');
|
|
7
|
+
|
|
8
|
+
exports.getOS = () => {
|
|
9
|
+
const { platform } = getConfig();
|
|
10
|
+
if (platform === 'darwin') {
|
|
11
|
+
return 'mac';
|
|
12
|
+
} else if (platform === 'win32') {
|
|
13
|
+
return 'win32';
|
|
14
|
+
} else {
|
|
15
|
+
return 'linux';
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.createTmpDir = async () => await fs.mkdtemp(`${os.tmpdir()}_AgoraTmp`);
|
|
20
|
+
|
|
21
|
+
exports.moveFile = (sp, tp) => {
|
|
22
|
+
logger.info(`move file from ${sp} to ${tp}`);
|
|
23
|
+
fs.rename(sp, tp, function (err) {
|
|
24
|
+
if (err) {
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.getIrisStandAlone = () => {
|
|
31
|
+
const { iris_sdk_mac, iris_sdk_win } = getConfig();
|
|
32
|
+
const os = this.getOS();
|
|
33
|
+
if (
|
|
34
|
+
(os === 'mac' &&
|
|
35
|
+
iris_sdk_mac &&
|
|
36
|
+
iris_sdk_mac.toLowerCase().indexOf('standalone') !== -1) ||
|
|
37
|
+
(os === 'win32' &&
|
|
38
|
+
iris_sdk_win &&
|
|
39
|
+
iris_sdk_win.toLowerCase().indexOf('standalone') !== -1)
|
|
40
|
+
) {
|
|
41
|
+
logger.info('iris use standalone package');
|
|
42
|
+
return true;
|
|
43
|
+
} else {
|
|
44
|
+
logger.info('iris use non-standalone package');
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const { exec } = require('shelljs');
|
|
5
|
+
|
|
6
|
+
const logger = require('./logger');
|
|
7
|
+
const { getOS } = require('./util');
|
|
8
|
+
|
|
9
|
+
const keepList = ['AgoraRtcWrapper', 'agora_node_ext'];
|
|
10
|
+
|
|
11
|
+
const filesMove = (src, dest, keepList) => {
|
|
12
|
+
fs.readdirSync(src).forEach((file) => {
|
|
13
|
+
const filePath = path.join(src, file);
|
|
14
|
+
const shouldKeep = keepList.some((pattern) => file.includes(pattern));
|
|
15
|
+
if (!shouldKeep) {
|
|
16
|
+
const destPath = path.join(dest, file);
|
|
17
|
+
fs.renameSync(filePath, destPath);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const zipBuild = async () => {
|
|
23
|
+
const temp_native = path.join(__dirname, '..', 'build', 'temp_native');
|
|
24
|
+
const build_release = path.join(__dirname, '..', 'build', 'Release');
|
|
25
|
+
fs.mkdirSync(temp_native);
|
|
26
|
+
filesMove(build_release, temp_native, keepList);
|
|
27
|
+
|
|
28
|
+
const isMac = getOS() === 'mac';
|
|
29
|
+
const fileListStr = ` build${path.sep}Release js types package.json`;
|
|
30
|
+
const shellStr =
|
|
31
|
+
(isMac ? 'zip -ry electron.zip' : '7z a electron.zip') + fileListStr;
|
|
32
|
+
const { code, stderr } = await exec(shellStr);
|
|
33
|
+
if (code !== 0) {
|
|
34
|
+
logger.error(stderr);
|
|
35
|
+
}
|
|
36
|
+
filesMove(temp_native, build_release, []);
|
|
37
|
+
fs.rmdirSync(temp_native, { recursive: true });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
module.exports = zipBuild;
|
package/ts/AgoraSdk.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IMediaPlayerCacheManager } from './Private/IAgoraMediaPlayer';
|
|
2
|
+
import { IRtcEngineEx } from './Private/IAgoraRtcEngineEx';
|
|
3
|
+
import { RtcEngineExInternal } from './Private/internal/RtcEngineExInternal';
|
|
4
|
+
import { AgoraEnvOptions } from './Types';
|
|
5
|
+
import { AgoraEnv } from './Utils';
|
|
6
|
+
|
|
7
|
+
export * from './Private/AgoraBase';
|
|
8
|
+
export * from './Private/AgoraMediaBase';
|
|
9
|
+
export * from './Private/AgoraMediaPlayerTypes';
|
|
10
|
+
export * from './Private/IAgoraLog';
|
|
11
|
+
export * from './Private/IAgoraMediaEngine';
|
|
12
|
+
export * from './Private/IAgoraMediaPlayer';
|
|
13
|
+
export * from './Private/IAgoraMediaPlayerSource';
|
|
14
|
+
export * from './Private/IAgoraMediaRecorder';
|
|
15
|
+
export * from './Private/IAgoraMusicContentCenter';
|
|
16
|
+
export * from './Private/IAgoraRhythmPlayer';
|
|
17
|
+
export * from './Private/IAgoraRtcEngine';
|
|
18
|
+
export * from './Private/IAgoraRtcEngineEx';
|
|
19
|
+
export * from './Private/IAgoraSpatialAudio';
|
|
20
|
+
export * from './Private/IAudioDeviceManager';
|
|
21
|
+
export * from './Renderer';
|
|
22
|
+
export * from './Types';
|
|
23
|
+
export * from './Utils';
|
|
24
|
+
|
|
25
|
+
const instance = new RtcEngineExInternal();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates one IRtcEngineEx object.
|
|
29
|
+
*
|
|
30
|
+
* Currently, the Agora RTC SDK v4.x supports creating only one IRtcEngineEx object for each app.
|
|
31
|
+
*
|
|
32
|
+
* @returns
|
|
33
|
+
* One IRtcEngineEx object.
|
|
34
|
+
*/
|
|
35
|
+
export function createAgoraRtcEngine(options?: AgoraEnvOptions): IRtcEngineEx {
|
|
36
|
+
Object.assign(AgoraEnv, options);
|
|
37
|
+
return instance;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gets one IMediaPlayerCacheManager instance.
|
|
42
|
+
*
|
|
43
|
+
* Before calling any APIs in the IMediaPlayerCacheManager class, you need to call this method to get a cache manager instance of a media player.
|
|
44
|
+
*
|
|
45
|
+
* @returns
|
|
46
|
+
* The IMediaPlayerCacheManager instance.
|
|
47
|
+
*/
|
|
48
|
+
export function getMediaPlayerCacheManager(): IMediaPlayerCacheManager {
|
|
49
|
+
return new IMediaPlayerCacheManagerImpl();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default createAgoraRtcEngine;
|
|
53
|
+
|
|
54
|
+
import { IMediaPlayerCacheManagerImpl } from './Private/impl/IAgoraMediaPlayerImpl';
|