Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ci/build/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ 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
export LANG=en_US.UTF-8

unzip_name=Agora_Native_SDK_for_iOS_FULL
zip_name=output.zip
sdk_url_flag=false
Expand Down
7 changes: 6 additions & 1 deletion .github/ci/build/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ 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
export LANG=en_US.UTF-8

unzip_name=Agora_Native_SDK_for_iOS_FULL
zip_name=output.zip
sdk_url_flag=false
Expand All @@ -60,7 +65,7 @@ if [ -z "$sdk_url" ]; then
sdk_url_flag=false
echo "sdk_url is empty"
echo unzip_name: $unzip_name
mkdir ./$unzip_name/samples
mkdir -p ./$unzip_name/samples
cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1
ls -al ./$unzip_name/samples/API-Example/
else
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ xcuserdata
.DS_Store
AgoraRtcKit.framework
*/libs
/sdk
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public boolean onEarMonitoringAudioFrame(int type, int samplesPerChannel, int by
}

@Override
public boolean onPlaybackAudioFrameBeforeMixing(String channelId, int uid, int type, int samplesPerChannel, int bytesPerSample, int channels, int samplesPerSec, ByteBuffer buffer, long renderTimeMs, int avsync_type, int rtpTimestamp) {
public boolean onPlaybackAudioFrameBeforeMixing(String channelId, int uid, int type, int samplesPerChannel, int bytesPerSample, int channels, int samplesPerSec, ByteBuffer buffer, long renderTimeMs, int avsync_type, int rtpTimestamp, long presentationMs) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Android/APIExample-Audio/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ android.enableJetifier=true
# read enable simple filter section on README first before set this flag to TRUE
simpleFilter = false

rtc_sdk_version = 4.5.0
rtc_sdk_version = 4.5.1
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ private class OriginAudioDataRewriter(
buffer: ByteBuffer?,
renderTimeMs: Long,
avsync_type: Int,
rtpTimestamp: Int
rtpTimestamp: Int,
presentationMs: Long
) = false

override fun getObservedAudioFramePosition() =
Expand Down
2 changes: 1 addition & 1 deletion Android/APIExample-Compose/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ kotlin.code.style=official
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

rtc_sdk_version = 4.5.0
rtc_sdk_version = 4.5.1
2 changes: 1 addition & 1 deletion Android/APIExample-Compose/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ composeBom = "2023.08.00"
loggingInterceptor = "4.10.0"
materialIconsExtended = "1.6.0"
navigationCompose = "2.7.7"
#agoraSdk = "4.5.0"
#agoraSdk = "4.5.1"
okhttp = "4.10.0"

[libraries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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,
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ class ILocalUserObserver {
/**
* datastream from this connection.
*/
virtual void onStreamMessage(user_id_t userId, int streamId, const char* data, size_t length) {}
virtual void onStreamMessage(user_id_t userId, int streamId, const char* data, size_t length, uint64_t sendTs = 0) {}

/**
* Occurs when the remote user state is updated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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,
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public boolean onEarMonitoringAudioFrame(int type, int samplesPerChannel, int by
}

@Override
public boolean onPlaybackAudioFrameBeforeMixing(String channelId, int uid, int type, int samplesPerChannel, int bytesPerSample, int channels, int samplesPerSec, ByteBuffer buffer, long renderTimeMs, int avsync_type, int rtpTimestamp) {
public boolean onPlaybackAudioFrameBeforeMixing(String channelId, int uid, int type, int samplesPerChannel, int bytesPerSample, int channels, int samplesPerSec, ByteBuffer buffer, long renderTimeMs, int avsync_type, int rtpTimestamp, long presentationMs) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Android/APIExample/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ simpleFilter = false
# read enable stream encrypt section on README first before set this flag to TRUE
streamEncrypt = false

rtc_sdk_version = 4.5.0
rtc_sdk_version = 4.5.1
4 changes: 2 additions & 2 deletions iOS/APIExample-Audio/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ target 'APIExample-Audio' do

pod 'Floaty', '~> 4.2.0'
pod 'AGEVideoLayout', '~> 1.0.2'
pod 'AgoraAudio_iOS', '4.5.0'
pod 'AgoraAudio_iOS', '4.5.1'
# pod 'sdk', :path => 'sdk.podspec'
end

pre_install do |installer|
# system("sh .download_script.sh 4.5.0 true")
# system("sh .download_script.sh 4.5.1 true")
end
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions iOS/APIExample-OC/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# platform :ios, '9.0'

def common_pods
pod 'AgoraRtcEngine_iOS', '4.5.0'
pod 'AgoraRtcEngine_iOS', '4.5.1'
# pod 'sdk', :path => 'sdk.podspec'
end

Expand All @@ -26,5 +26,5 @@ target 'SimpleFilter' do
end

pre_install do |installer|
# system("sh .download_script.sh 4.5.0 true")
# system("sh .download_script.sh 4.5.1 true")
end
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct CustomRenderExample: View {
VStack(spacing: 30) {
PIPDisplayView(viewModel: pipViewModel)
.frame(maxWidth: .infinity, maxHeight: 200)

Button {
pipViewModel.togglePiP()
} label: {
Expand Down Expand Up @@ -78,7 +78,6 @@ struct CustomRenderExample: View {
customRenderViewModel.cleanRtc()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.adaptiveBackground(Color.orange)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,24 @@ 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) {
guard let pipSourceView = backgroundView.pipSourceView else { return }

pipSourceView.removeFromSuperview()
backgroundView.addSubview(pipSourceView)
pipSourceView.frame = backgroundView.bounds
pipSourceView.setNeedsLayout()
pipSourceView.layoutIfNeeded()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SDKRenderMockContainerView: View {

var body: some View {
HStack {
localView.frame(maxWidth: 200)
localView
ForEach(viewModel.remoteRenderViews) { view in
view
}
Expand Down Expand Up @@ -77,7 +77,6 @@ struct SDKRenderExample: View {
sdkRenderViewModel.cleanRtc()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.adaptiveBackground(Color.orange)
}
}

Expand Down
4 changes: 2 additions & 2 deletions iOS/APIExample-SwiftUI/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# platform :ios, '9.0'

def common_pods
pod 'AgoraRtcEngine_iOS', '4.5.0'
pod 'AgoraRtcEngine_iOS', '4.5.1'
# pod 'sdk', :path => 'sdk.podspec'
end

Expand Down Expand Up @@ -33,5 +33,5 @@ end
#end

pre_install do |installer|
# system("sh .download_script.sh 4.5.0 true")
# system("sh .download_script.sh 4.5.1 true")
end
Loading
Loading