From 1bc28835cd61c349532bc9b025091135c56a752b Mon Sep 17 00:00:00 2001 From: zhangwei Date: Fri, 14 Feb 2025 21:29:59 +0800 Subject: [PATCH 01/12] [Android]update .h --- .gitignore | 1 + .../src/main/cpp/AgoraRtcKit/AgoraBase.h | 16 ++++++++++++++-- .../src/main/cpp/include/agora/AgoraBase.h | 16 ++++++++++++++-- .../examples/advanced/PictureInPicture.java | 11 ++++++++++- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b27e7ef9b..606b91bdf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ xcuserdata .DS_Store AgoraRtcKit.framework */libs +/sdk diff --git a/Android/APIExample/agora-simple-filter/src/main/cpp/AgoraRtcKit/AgoraBase.h b/Android/APIExample/agora-simple-filter/src/main/cpp/AgoraRtcKit/AgoraBase.h index c3bfa34cb..9f106238d 100644 --- a/Android/APIExample/agora-simple-filter/src/main/cpp/AgoraRtcKit/AgoraBase.h +++ b/Android/APIExample/agora-simple-filter/src/main/cpp/AgoraRtcKit/AgoraBase.h @@ -427,6 +427,10 @@ enum WARN_CODE_TYPE { * 1053: Audio Device Module: The settings are improper. */ WARN_ADM_IMPROPER_SETTINGS = 1053, + /** + * 1055: Audio Device Module: The audio device is in a pop state. + */ + WARN_ADM_POP_STATE = 1055, /** * 1322: No recording device. */ @@ -2701,9 +2705,17 @@ enum AUDIO_SCENARIO_TYPE { */ AUDIO_SCENARIO_MEETING = 8, /** - * 9: The number of enumerations. + * 9: AI Server. + */ + AUDIO_SCENARIO_AI_SERVER = 9, + /** + * 10: AI Client. + */ + AUDIO_SCENARIO_AI_CLIENT = 10, + /** + * 11: The number of enumerations. */ - AUDIO_SCENARIO_NUM = 9, + AUDIO_SCENARIO_NUM = 11, }; /** diff --git a/Android/APIExample/agora-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h b/Android/APIExample/agora-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h index c3bfa34cb..9f106238d 100644 --- a/Android/APIExample/agora-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h +++ b/Android/APIExample/agora-stream-encrypt/src/main/cpp/include/agora/AgoraBase.h @@ -427,6 +427,10 @@ enum WARN_CODE_TYPE { * 1053: Audio Device Module: The settings are improper. */ WARN_ADM_IMPROPER_SETTINGS = 1053, + /** + * 1055: Audio Device Module: The audio device is in a pop state. + */ + WARN_ADM_POP_STATE = 1055, /** * 1322: No recording device. */ @@ -2701,9 +2705,17 @@ enum AUDIO_SCENARIO_TYPE { */ AUDIO_SCENARIO_MEETING = 8, /** - * 9: The number of enumerations. + * 9: AI Server. + */ + AUDIO_SCENARIO_AI_SERVER = 9, + /** + * 10: AI Client. + */ + AUDIO_SCENARIO_AI_CLIENT = 10, + /** + * 11: The number of enumerations. */ - AUDIO_SCENARIO_NUM = 9, + AUDIO_SCENARIO_NUM = 11, }; /** diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PictureInPicture.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PictureInPicture.java index 4c21e0082..87913abe3 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PictureInPicture.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/PictureInPicture.java @@ -210,6 +210,10 @@ public void onPermissionsResult(boolean allPermissionsGranted, String[] permissi fl_remote3.removeAllViews(); } } else if (v.getId() == switch_float_window.getId()) { + if (Build.VERSION.SDK_INT >= 26 && requireActivity().isInPictureInPictureMode()) { + showLongToast("Please exit Picture-in-Picture mode first"); + return; + } showFloatWindow(); } else if (v.getId() == R.id.btn_pip) { if (checkPipSupported()) { @@ -500,7 +504,7 @@ private VideoReportLayout getRemoteView(int uid) { private void showFloatWindow() { FragmentActivity context = requireActivity(); if (FloatWindowHelper.checkPermission(context)) { - if (isFloatWindowShowing()) { + if (isFloatWindowShowing() || (Build.VERSION.SDK_INT >= 26 && requireActivity().isInPictureInPictureMode())) { return; } floatWindowView = FloatWindowHelper.createFloatView(context, 50, 50); @@ -563,6 +567,11 @@ private void enterPip() { if (android.os.Build.VERSION.SDK_INT < 26) { return; } + + if(isFloatWindowShowing()) { + dismissFloatWindow(); + } + requireActivity().enterPictureInPictureMode(pictureInPictureParamsBuilder .setAspectRatio(new Rational(video_layout_container.getWidth(), video_layout_container.getHeight())) .build()); From 8eab616e4d95f41b9e03b349be4f8a03791441cf Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Mon, 17 Feb 2025 18:14:28 +0800 Subject: [PATCH 02/12] Modify the ci script --- .github/ci/build/build_ios.sh | 4 ++++ .github/ci/build/build_mac.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 6cfc26eb0..05e5cf415 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -53,6 +53,10 @@ echo short_version: $short_version echo pwd: `pwd` echo sdk_url: $sdk_url +export https_proxy=10.10.114.55:1080 +export http_proxy=10.10.114.55:1080 +export all_proxy=10.10.114.55:1080 + unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip sdk_url_flag=false diff --git a/.github/ci/build/build_mac.sh b/.github/ci/build/build_mac.sh index e0d163db8..d879e8cdc 100644 --- a/.github/ci/build/build_mac.sh +++ b/.github/ci/build/build_mac.sh @@ -51,6 +51,10 @@ echo short_version: $short_version echo pwd: `pwd` echo sdk_url: $sdk_url +export https_proxy=10.10.114.55:1080 +export http_proxy=10.10.114.55:1080 +export all_proxy=10.10.114.55:1080 + unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip sdk_url_flag=false From 49f9433735fc98d0cf98cb58c43c308bbaa5ae47 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Mon, 17 Feb 2025 18:31:20 +0800 Subject: [PATCH 03/12] modify ci script --- .github/ci/build/build_ios.sh | 1 + .github/ci/build/build_mac.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 05e5cf415..619315616 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -56,6 +56,7 @@ echo sdk_url: $sdk_url export https_proxy=10.10.114.55:1080 export http_proxy=10.10.114.55:1080 export all_proxy=10.10.114.55:1080 +export LANG=en_US.UTF-8 unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip diff --git a/.github/ci/build/build_mac.sh b/.github/ci/build/build_mac.sh index d879e8cdc..da447e692 100644 --- a/.github/ci/build/build_mac.sh +++ b/.github/ci/build/build_mac.sh @@ -54,6 +54,7 @@ echo sdk_url: $sdk_url export https_proxy=10.10.114.55:1080 export http_proxy=10.10.114.55:1080 export all_proxy=10.10.114.55:1080 +export LANG=en_US.UTF-8 unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip From ecfe2e9ac9a7f68357b97c9b3a6a8c098ed914d1 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Mon, 17 Feb 2025 21:22:47 +0800 Subject: [PATCH 04/12] Fix picture-in-picture issue --- .../CustomRender/CustomRenderExample.swift | 3 +-- .../PictureInPicture/PIPCommon/PIPDisplayView.swift | 12 +++++++++++- .../SDKRender/SDKRenderExample.swift | 3 +-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/CustomRender/CustomRenderExample.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/CustomRender/CustomRenderExample.swift index 29f2aa4ba..1663b9b0d 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/CustomRender/CustomRenderExample.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/CustomRender/CustomRenderExample.swift @@ -49,7 +49,7 @@ struct CustomRenderExample: View { VStack(spacing: 30) { PIPDisplayView(viewModel: pipViewModel) .frame(maxWidth: .infinity, maxHeight: 200) - + Button { pipViewModel.togglePiP() } label: { @@ -78,7 +78,6 @@ struct CustomRenderExample: View { customRenderViewModel.cleanRtc() } .frame(maxWidth: .infinity, maxHeight: .infinity) - .adaptiveBackground(Color.orange) } } diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/PIPCommon/PIPDisplayView.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/PIPCommon/PIPDisplayView.swift index a0782f96b..7ad1f0147 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/PIPCommon/PIPDisplayView.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/PIPCommon/PIPDisplayView.swift @@ -100,7 +100,14 @@ extension PIPViewModel: AVPictureInPictureControllerDelegate { guard let vc = pictureInPictureController.contentSource?.activeVideoCallContentViewController, let pipSourceView = backgroundView.pipSourceView else { return } vc.view.addSubview(pipSourceView) - pipSourceView.frame = vc.view.bounds + pipSourceView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + pipSourceView.leadingAnchor.constraint(equalTo: vc.view.leadingAnchor), + pipSourceView.trailingAnchor.constraint(equalTo: vc.view.trailingAnchor), + pipSourceView.topAnchor.constraint(equalTo: vc.view.topAnchor), + pipSourceView.bottomAnchor.constraint(equalTo: vc.view.bottomAnchor) + ]) + vc.view.layoutIfNeeded() } func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { @@ -108,6 +115,9 @@ extension PIPViewModel: AVPictureInPictureControllerDelegate { pipSourceView.removeFromSuperview() backgroundView.addSubview(pipSourceView) + pipSourceView.frame = backgroundView.bounds + pipSourceView.setNeedsLayout() + pipSourceView.layoutIfNeeded() } } diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/SDKRender/SDKRenderExample.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/SDKRender/SDKRenderExample.swift index 2e35b343e..64641b951 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/SDKRender/SDKRenderExample.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/PictureInPicture/SDKRender/SDKRenderExample.swift @@ -13,7 +13,7 @@ struct SDKRenderMockContainerView: View { var body: some View { HStack { - localView.frame(maxWidth: 200) + localView ForEach(viewModel.remoteRenderViews) { view in view } @@ -77,7 +77,6 @@ struct SDKRenderExample: View { sdkRenderViewModel.cleanRtc() } .frame(maxWidth: .infinity, maxHeight: .infinity) - .adaptiveBackground(Color.orange) } } From c0f52fc2d5fe688bfc1a0c6dd14ab97c260d5736 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Mon, 17 Feb 2025 21:43:05 +0800 Subject: [PATCH 05/12] Fix audio self-rendering issue. --- .../Examples/Advanced/CustomAudioRender/CustomAudioRender.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/CustomAudioRender/CustomAudioRender.m b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/CustomAudioRender/CustomAudioRender.m index 85989534d..8264d3f13 100644 --- a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/CustomAudioRender/CustomAudioRender.m +++ b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/CustomAudioRender/CustomAudioRender.m @@ -94,7 +94,8 @@ - (void)viewDidLoad { NSString *channelName = [self.configs objectForKey:@"channelName"]; // enable video module and set up video encoding configs [self.agoraKit enableAudio]; - + [self.agoraKit setAudioScenario:AgoraAudioScenarioGameStreaming]; + // set up local video to render your local camera preview AgoraRtcVideoCanvas *videoCanvas = [[AgoraRtcVideoCanvas alloc] init]; videoCanvas.uid = 0; @@ -113,7 +114,7 @@ - (void)viewDidLoad { // when joining channel. The channel name and uid used to calculate // the token has to match the ones used for channel join AgoraRtcChannelMediaOptions *options = [[AgoraRtcChannelMediaOptions alloc] init]; - options.publishMicrophoneTrack = NO; + options.publishMicrophoneTrack = YES; options.publishCameraTrack = NO; options.autoSubscribeAudio = YES; options.autoSubscribeVideo = NO; From 4d89d0a9d97534a04d5faa1b6a653b2c6b53779c Mon Sep 17 00:00:00 2001 From: HeZhengQing Date: Tue, 18 Feb 2025 11:55:44 +0800 Subject: [PATCH 06/12] [FIX] NMS-24996 --- .../Examples/Advanced/StreamEncryption/StreamEncryption.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/StreamEncryption/StreamEncryption.m b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/StreamEncryption/StreamEncryption.m index 4d880ca67..4b2df6ce2 100644 --- a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/StreamEncryption/StreamEncryption.m +++ b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/StreamEncryption/StreamEncryption.m @@ -116,7 +116,7 @@ - (void)viewDidLoad { NSString *channelName = [self.configs objectForKey:@"channelName"]; NSString *secret = [self.configs objectForKey:@"secret"]; AgoraEncryptionMode mode = ((NSNumber *)[self.configs objectForKey:@"mode"]).integerValue; - BOOL useCustom = ((NSNumber *)[self.configs objectForKey:@"useCustom"]).boolValue; + BOOL useCustom = ((NSNumber *)[self.configs objectForKey:@"userCustom"]).boolValue; // make myself a broadcaster [self.agoraKit setClientRole:(AgoraClientRoleBroadcaster)]; // enable video module and set up video encoding configs From 62f0d8989e459c05619141a5e03c029b7a6e6e9f Mon Sep 17 00:00:00 2001 From: HeZhengQing Date: Tue, 18 Feb 2025 20:13:26 +0800 Subject: [PATCH 07/12] [FIX] camera focal --- .../Base.lproj/LiveStreaming.storyboard | 34 ++++++------------- .../LiveStreaming/LiveStreaming.swift | 27 --------------- iOS/APIExample/Podfile | 6 ++-- 3 files changed, 14 insertions(+), 53 deletions(-) diff --git a/iOS/APIExample/APIExample/Examples/Advanced/LiveStreaming/Base.lproj/LiveStreaming.storyboard b/iOS/APIExample/APIExample/Examples/Advanced/LiveStreaming/Base.lproj/LiveStreaming.storyboard index d433b379b..e70aad271 100644 --- a/iOS/APIExample/APIExample/Examples/Advanced/LiveStreaming/Base.lproj/LiveStreaming.storyboard +++ b/iOS/APIExample/APIExample/Examples/Advanced/LiveStreaming/Base.lproj/LiveStreaming.storyboard @@ -42,7 +42,7 @@ @@ -194,7 +186,7 @@ - + - + - +