diff --git a/.github/ci/build/build_ios_ipa.sh b/.github/ci/build/build_ios_ipa.sh
index 71f5f191e..7badd7a4d 100755
--- a/.github/ci/build/build_ios_ipa.sh
+++ b/.github/ci/build/build_ios_ipa.sh
@@ -142,17 +142,18 @@ cd ${WORKSPACE}
# sh sign "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --type xcarchive --plist "${PLIST_PATH}"
sh export "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --plist "${PLIST_PATH}"
+SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5)
# 上传IPA
-PAYLOAD_PATH="${TARGET_NAME}_${BUILD_NUMBER}_Payload"
+PAYLOAD_PATH="${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}_Payload"
mkdir "${PAYLOAD_PATH}"
# mv "${TARGET_NAME}_${BUILD_NUMBER}_iOS.ipa" "${PAYLOAD_PATH}"
mv "${TARGET_NAME}_${BUILD_NUMBER}.ipa" "${PAYLOAD_PATH}"
-7za a "${TARGET_NAME}_${BUILD_NUMBER}_IPA.zip" -r "${PAYLOAD_PATH}"
-python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_${BUILD_NUMBER}_IPA.zip" --project
+7za a "${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}_IPA.zip" -r "${PAYLOAD_PATH}"
+python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}_IPA.zip" --project
# 删除IPA文件夹
-rm -rf ${TARGET_NAME}_${BUILD_NUMBER}.xcarchive
+rm -rf ${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}.xcarchive
rm -rf *.zip
rm -rf ${PAYLOAD_PATH}
diff --git a/.github/ci/build/build_mac.sh b/.github/ci/build/build_mac.sh
index 1ba0323f4..9a2e0deeb 100644
--- a/.github/ci/build/build_mac.sh
+++ b/.github/ci/build/build_mac.sh
@@ -81,5 +81,4 @@ if [ $is_generate_validate_app = true ]; then
fi
7za a -tzip result.zip -r $unzip_name
-# 7za a -tzip result.zip -r Agora_Native_SDK_for_Mac_FULL
cp result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
diff --git a/.github/ci/build/build_mac_ipa.sh b/.github/ci/build/build_mac_ipa.sh
index 21e5b2125..7c295439c 100755
--- a/.github/ci/build/build_mac_ipa.sh
+++ b/.github/ci/build/build_mac_ipa.sh
@@ -68,6 +68,8 @@ xcodebuild clean -workspace "${APP_PATH}" -configuration "${CONFIGURATION}" -sch
# 时间戳
CURRENT_TIME=$(date "+%Y-%m-%d %H-%M-%S")
+SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5)
+
# 归档路径
ARCHIVE_PATH="${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive"
# 编译环境
@@ -88,8 +90,11 @@ cd ${WORKSPACE}
# 签名
sh sign "${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --type xcarchive --plist "${PLIST_PATH}" --application macApp
+# 重命名
+cp "${TARGET_NAME}_${BUILD_NUMBER}.app.zip" "${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}.app.zip"
+
# 上传IPA
-python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_${BUILD_NUMBER}.app.zip" --project
+python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_SDK_${SDK_VERSION}_CI_${BUILD_NUMBER}.app.zip" --project
# 删除archive文件
rm -rf ${TARGET_NAME}_${BUILD_NUMBER}.xcarchive
diff --git a/Android/APIExample-Audio/app/src/main/java/io/agora/api/example/examples/advanced/PreCallTest.java b/Android/APIExample-Audio/app/src/main/java/io/agora/api/example/examples/advanced/PreCallTest.java
index 7f187e113..faee2efad 100644
--- a/Android/APIExample-Audio/app/src/main/java/io/agora/api/example/examples/advanced/PreCallTest.java
+++ b/Android/APIExample-Audio/app/src/main/java/io/agora/api/example/examples/advanced/PreCallTest.java
@@ -15,6 +15,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
@@ -24,6 +25,7 @@
import io.agora.api.example.common.BaseFragment;
import io.agora.api.example.common.model.StatisticsInfo;
import io.agora.rtc2.Constants;
+import io.agora.rtc2.EchoTestConfiguration;
import io.agora.rtc2.IRtcEngineEventHandler;
import io.agora.rtc2.RtcEngine;
import io.agora.rtc2.RtcEngineConfig;
@@ -159,7 +161,13 @@ public void onClick(View v) {
}
else if (v.getId() == R.id.btn_echo){
num = 0;
- engine.startEchoTest(MAX_COUNT_DOWN);
+ engine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
+ EchoTestConfiguration config = new EchoTestConfiguration();
+ config.enableVideo = false;
+ config.enableAudio = true;
+ config.intervalInSeconds = MAX_COUNT_DOWN;
+ config.channelId = (new Random().nextInt(10000) + 100000) + "";
+ engine.startEchoTest(config);
btn_echo.setEnabled(false);
btn_echo.setText("Recording on Microphone ...");
echoTimer = new Timer(true);
diff --git a/Android/APIExample-Audio/gradle/wrapper/gradle-wrapper.properties b/Android/APIExample-Audio/gradle/wrapper/gradle-wrapper.properties
index 04180faf8..89d7ee3b3 100644
--- a/Android/APIExample-Audio/gradle/wrapper/gradle-wrapper.properties
+++ b/Android/APIExample-Audio/gradle/wrapper/gradle-wrapper.properties
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
-# distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
+#distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
diff --git a/Android/APIExample/app/src/main/AndroidManifest.xml b/Android/APIExample/app/src/main/AndroidManifest.xml
index fcc3933c2..9a95d9d52 100644
--- a/Android/APIExample/app/src/main/AndroidManifest.xml
+++ b/Android/APIExample/app/src/main/AndroidManifest.xml
@@ -46,16 +46,6 @@
-
-
-
-
= Build.VERSION_CODES.Q) {
- fgServiceIntent = new Intent(getActivity(), ScreenSharing.MediaProjectFgService.class);
- }
try {
RtcEngineConfig config = new RtcEngineConfig();
/*
@@ -176,9 +161,6 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
@Override
public void onDestroy() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().stopService(fgServiceIntent);
- }
/*leaveChannel and Destroy the RtcEngine instance*/
if (engine != null) {
engine.leaveChannel();
@@ -284,10 +266,6 @@ private void joinChannel(String channelId) {
/*Set up to play remote sound with receiver*/
engine.setDefaultAudioRoutetoSpeakerphone(true);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().startForegroundService(fgServiceIntent);
- }
-
DisplayMetrics metrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
screenCaptureParameters.captureVideo = true;
@@ -490,9 +468,6 @@ private void leaveChannel() {
remoteUid = -1;
myUid = -1;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().stopService(fgServiceIntent);
- }
engine.leaveChannel();
engine.stopScreenCapture();
engine.stopPreview();
@@ -531,61 +506,4 @@ public void onNothingSelected(AdapterView> parent) {
}
- /**
- * The type Media project fg service.
- */
- public static class MediaProjectFgService extends Service {
- @Nullable
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- createNotificationChannel();
- }
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- return START_NOT_STICKY;
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- stopForeground(true);
- }
-
- @RequiresApi(api = Build.VERSION_CODES.O)
- private void createNotificationChannel() {
- CharSequence name = getString(R.string.app_name);
- String description = "Notice that we are trying to capture the screen!!";
- int importance = NotificationManager.IMPORTANCE_HIGH;
- String channelId = "agora_channel_mediaproject";
- NotificationChannel channel = new NotificationChannel(channelId, name, importance);
- channel.setDescription(description);
- channel.enableLights(true);
- channel.setLightColor(Color.RED);
- channel.enableVibration(true);
- channel.setVibrationPattern(
- new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
- NotificationManager notificationManager = (NotificationManager)
- getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.createNotificationChannel(channel);
- int notifyId = 1;
- // Create a notification and set the notification channel.
- Notification notification = new NotificationCompat.Builder(this, channelId)
- .setContentText(name + "正在录制屏幕内容...")
- .setSmallIcon(R.mipmap.ic_launcher)
- .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
- .setChannelId(channelId)
- .setWhen(System.currentTimeMillis())
- .build();
- startForeground(notifyId, notification);
- }
- }
}
diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchCameraScreenShare.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchCameraScreenShare.java
index ec359d86d..c43715dcc 100644
--- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchCameraScreenShare.java
+++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchCameraScreenShare.java
@@ -6,17 +6,9 @@
import static io.agora.rtc2.video.VideoEncoderConfiguration.STANDARD_BITRATE;
import static io.agora.rtc2.video.VideoEncoderConfiguration.VD_640x360;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.Service;
import android.content.Context;
-import android.content.Intent;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
-import android.os.IBinder;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
@@ -31,8 +23,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.core.app.NotificationCompat;
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.runtime.Permission;
@@ -78,7 +68,6 @@ public class SwitchCameraScreenShare extends BaseFragment implements View.OnClic
private boolean joined = false;
private int curRenderMode = RENDER_MODE_HIDDEN;
private ChannelMediaOptions options = new ChannelMediaOptions();
- private Intent fgServiceIntent;
private RtcEngineEx engine;
private RtcConnection rtcConnection2 = new RtcConnection();
@@ -114,9 +103,6 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
if (context == null) {
return;
}
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- fgServiceIntent = new Intent(getActivity(), MediaProjectFgService.class);
- }
try {
RtcEngineConfig config = new RtcEngineConfig();
/*
@@ -168,9 +154,6 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
@Override
public void onDestroy() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().stopService(fgServiceIntent);
- }
/*leaveChannel and Destroy the RtcEngine instance*/
if (engine != null) {
if (camera.isChecked()) {
@@ -189,10 +172,7 @@ public void onDestroy() {
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (compoundButton.getId() == R.id.screenShare) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
- if (b) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().startForegroundService(fgServiceIntent);
- }
+ if(b){
DisplayMetrics metrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
ScreenCaptureParameters parameters = new ScreenCaptureParameters();
@@ -210,9 +190,6 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
} else {
// stop screen capture and update options
engine.stopScreenCapture();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- getActivity().stopService(fgServiceIntent);
- }
options.publishScreenCaptureVideo = false;
engine.updateChannelMediaOptions(options);
}
@@ -527,61 +504,4 @@ public void onUserOffline(int uid, int reason) {
}
};
- /**
- * The type Media project fg service.
- */
- public static class MediaProjectFgService extends Service {
- @Nullable
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
- createNotificationChannel();
- }
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- return START_NOT_STICKY;
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- stopForeground(true);
- }
-
- @RequiresApi(api = Build.VERSION_CODES.O)
- private void createNotificationChannel() {
- CharSequence name = getString(R.string.app_name);
- String description = "Notice that we are trying to capture the screen!!";
- int importance = NotificationManager.IMPORTANCE_HIGH;
- String channelId = "agora_channel_mediaproject";
- NotificationChannel channel = new NotificationChannel(channelId, name, importance);
- channel.setDescription(description);
- channel.enableLights(true);
- channel.setLightColor(Color.RED);
- channel.enableVibration(true);
- channel.setVibrationPattern(
- new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
- NotificationManager notificationManager = (NotificationManager)
- getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.createNotificationChannel(channel);
- int notifyId = 1;
- // Create a notification and set the notification channel.
- Notification notification = new NotificationCompat.Builder(this, channelId)
- .setContentText(name + "正在录制屏幕内容...")
- .setSmallIcon(R.mipmap.ic_launcher)
- .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
- .setChannelId(channelId)
- .setWhen(System.currentTimeMillis())
- .build();
- startForeground(notifyId, notification);
- }
- }
}
diff --git a/Android/APIExample/gradle/wrapper/gradle-wrapper.properties b/Android/APIExample/gradle/wrapper/gradle-wrapper.properties
index 04180faf8..89d7ee3b3 100644
--- a/Android/APIExample/gradle/wrapper/gradle-wrapper.properties
+++ b/Android/APIExample/gradle/wrapper/gradle-wrapper.properties
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
-# distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
+#distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
diff --git a/iOS/APIExample-Audio/Podfile b/iOS/APIExample-Audio/Podfile
index d3998c2da..9ad892601 100644
--- a/iOS/APIExample-Audio/Podfile
+++ b/iOS/APIExample-Audio/Podfile
@@ -7,7 +7,7 @@ target 'APIExample-Audio' do
pod 'Floaty', '~> 4.2.0'
pod 'AGEVideoLayout', '~> 1.0.2'
- pod 'AgoraAudio_iOS', '4.2.3'
+ pod 'AgoraAudio_iOS', '4.2.6'
# pod 'sdk', :path => 'sdk.podspec'
end
diff --git a/iOS/APIExample-OC/Agora-ScreenShare-Extension-OC/SampleHandler.m b/iOS/APIExample-OC/Agora-ScreenShare-Extension-OC/SampleHandler.m
index 694363e6a..c69133eb6 100644
--- a/iOS/APIExample-OC/Agora-ScreenShare-Extension-OC/SampleHandler.m
+++ b/iOS/APIExample-OC/Agora-ScreenShare-Extension-OC/SampleHandler.m
@@ -8,7 +8,7 @@
#import "SampleHandler.h"
-@interface SampleHandler ()
+@interface SampleHandler ()
@end
@@ -16,51 +16,29 @@ @implementation SampleHandler
- (void)broadcastStartedWithSetupInfo:(NSDictionary *)setupInfo {
// User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional.
- [[AgoraReplayKitExt shareInstance] start:self];
+ [super broadcastStartedWithSetupInfo:setupInfo];
}
- (void)broadcastPaused {
// User has requested to pause the broadcast. Samples will stop being delivered.
NSLog(@"broadcastPaused");
- [[AgoraReplayKitExt shareInstance] pause];
+ [super broadcastPaused];
}
- (void)broadcastResumed {
// User has requested to resume the broadcast. Samples delivery will resume.
NSLog(@"broadcastResumed");
- [[AgoraReplayKitExt shareInstance] resume];
+ [super broadcastResumed];
}
- (void)broadcastFinished {
// User has requested to finish the broadcast.
NSLog(@"broadcastFinished");
- [[AgoraReplayKitExt shareInstance] stop];
+ [super broadcastFinished];
}
- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType {
- [[AgoraReplayKitExt shareInstance] pushSampleBuffer:sampleBuffer withType:sampleBufferType];
+ [super processSampleBuffer:sampleBuffer withType:sampleBufferType];
}
-//- (void)broadcastFinished:(AgoraReplayKitExt * _Nonnull)broadcast reason:(AgoraReplayKitExtReason)reason {
-// switch (reason) {
-// case AgoraReplayKitExtReasonInitiativeStop:
-// {
-// NSLog(@"AgoraReplayKitExtReasonInitiativeStop");
-// }
-// break;
-// case AgoraReplayKitExtReasonConnectFail:
-// {
-// NSLog(@"AgoraReplayKitExReasonConnectFail");
-// }
-// break;
-// case AgoraReplayKitExtReasonDisconnect:
-// {
-// NSLog(@"AgoraReplayKitExReasonDisconnect");
-// }
-// break;
-// default:
-// break;
-// }
-//}
-
@end
diff --git a/iOS/APIExample-OC/Podfile b/iOS/APIExample-OC/Podfile
index efe567678..c7120307e 100644
--- a/iOS/APIExample-OC/Podfile
+++ b/iOS/APIExample-OC/Podfile
@@ -5,7 +5,7 @@ target 'APIExample-OC' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
- pod 'AgoraRtcEngine_iOS', '4.2.3'
+ pod 'AgoraRtcEngine_iOS', '4.2.6'
# pod 'sdk', :path => 'sdk.podspec'
@@ -14,11 +14,11 @@ end
target 'Agora-ScreenShare-Extension-OC' do
use_frameworks!
# pod 'sdk', :path => 'sdk.podspec'
-pod 'AgoraRtcEngine_iOS', '4.2.3'
+pod 'AgoraRtcEngine_iOS', '4.2.6'
end
target 'SimpleFilter' do
use_frameworks!
# pod 'sdk', :path => 'sdk.podspec'
- pod 'AgoraRtcEngine_iOS', '4.2.3'
+ pod 'AgoraRtcEngine_iOS', '4.2.6'
end
diff --git a/iOS/APIExample/Agora-ScreenShare-Extension/SampleHandler.swift b/iOS/APIExample/Agora-ScreenShare-Extension/SampleHandler.swift
index bc4409e87..b1995255b 100644
--- a/iOS/APIExample/Agora-ScreenShare-Extension/SampleHandler.swift
+++ b/iOS/APIExample/Agora-ScreenShare-Extension/SampleHandler.swift
@@ -8,42 +8,27 @@
import ReplayKit
-class SampleHandler: AgoraReplayKitHandler, AgoraReplayKitExtDelegate {
+class SampleHandler: AgoraReplayKitHandler {
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
// User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional.
- AgoraReplayKitExt.shareInstance().start(self)
+ super.broadcastStarted(withSetupInfo: setupInfo)
}
override func broadcastPaused() {
// User has requested to pause the broadcast. Samples will stop being delivered.
- AgoraReplayKitExt.shareInstance().pause()
+ super.broadcastPaused()
}
override func broadcastResumed() {
// User has requested to resume the broadcast. Samples delivery will resume.
- AgoraReplayKitExt.shareInstance().resume()
+ super.broadcastResumed()
}
override func broadcastFinished() {
// User has requested to finish the broadcast.
- AgoraReplayKitExt.shareInstance().stop()
+ super.broadcastFinished()
}
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
- AgoraReplayKitExt.shareInstance().push(sampleBuffer, with: sampleBufferType)
- }
-
- func broadcastFinished(_ broadcast: AgoraReplayKitExt, reason: AgoraReplayKitExtReason) {
- switch reason {
- case AgoraReplayKitExtReasonInitiativeStop:
- print("AgoraReplayKitExtReasonInitiativeStop")
-
- case AgoraReplayKitExtReasonConnectFail:
- print("AgoraReplayKitExReasonConnectFail")
-
- case AgoraReplayKitExtReasonDisconnect:
- print("AgoraReplayKitExReasonDisconnect")
-
- default: break
- }
+ super.processSampleBuffer(sampleBuffer, with: sampleBufferType)
}
}
diff --git a/iOS/APIExample/Podfile b/iOS/APIExample/Podfile
index cfc8e1492..019197643 100644
--- a/iOS/APIExample/Podfile
+++ b/iOS/APIExample/Podfile
@@ -9,7 +9,7 @@ target 'APIExample' do
pod 'AGEVideoLayout', '~> 1.0.2'
pod 'CocoaAsyncSocket', '7.6.5'
pod 'ijkplayer', '~> 1.1.3'
- pod 'AgoraRtcEngine_iOS', '4.2.3'
+ pod 'AgoraRtcEngine_iOS', '4.2.6'
# pod 'sdk', :path => 'sdk.podspec'
# pod 'senseLib', :path => 'sense.podspec'
# pod 'bytedEffect', :path => 'bytedEffect.podspec'
@@ -19,11 +19,11 @@ end
target 'Agora-ScreenShare-Extension' do
use_frameworks!
# pod 'sdk', :path => 'sdk.podspec'
- pod 'AgoraRtcEngine_iOS', '4.2.3'
+ pod 'AgoraRtcEngine_iOS', '4.2.6'
end
target 'SimpleFilter' do
use_frameworks!
# pod 'sdk', :path => 'sdk.podspec'
- pod 'AgoraRtcEngine_iOS', '4.2.3'
+ pod 'AgoraRtcEngine_iOS', '4.2.6'
end
diff --git a/macOS/APIExample/Examples/Advanced/LiveStreaming/LiveStreaming.swift b/macOS/APIExample/Examples/Advanced/LiveStreaming/LiveStreaming.swift
index ffc3b02a8..a8ada3332 100644
--- a/macOS/APIExample/Examples/Advanced/LiveStreaming/LiveStreaming.swift
+++ b/macOS/APIExample/Examples/Advanced/LiveStreaming/LiveStreaming.swift
@@ -473,10 +473,12 @@ class LiveStreamingMain: BaseViewController {
// the view to be binded
videoCanvas.view = localVideo.videocanvas
videoCanvas.renderMode = .hidden
- agoraKit.setupLocalVideo(videoCanvas)
// you have to call startPreview to see local video
+ agoraKit.setupLocalVideo(videoCanvas)
if role == .broadcaster {
agoraKit.startPreview()
+ } else {
+ agoraKit.stopPreview()
}
// start joining channel
diff --git a/macOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift b/macOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift
index ed491c80d..87eb32ed7 100644
--- a/macOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift
+++ b/macOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift
@@ -238,7 +238,13 @@ class SimpleFilterMain: BaseViewController {
selectRolePicker.onSelectChanged {
guard let selected = self.selectedRole else { return }
if self.isJoined {
+ let mediaOption = AgoraRtcChannelMediaOptions()
+ mediaOption.publishCameraTrack = selected == .broadcaster
+ mediaOption.publishMicrophoneTrack = selected == .broadcaster
+ mediaOption.clientRoleType = selected
+ self.agoraKit.updateChannel(with: mediaOption)
self.agoraKit.setClientRole(selected)
+ _ = selected == .broadcaster ? self.agoraKit.startPreview() : self.agoraKit.stopPreview()
}
}
}
@@ -371,7 +377,11 @@ class SimpleFilterMain: BaseViewController {
videoCanvas.renderMode = .hidden
agoraKit.setupLocalVideo(videoCanvas)
// you have to call startPreview to see local video
- agoraKit.startPreview()
+ if role == .broadcaster {
+ agoraKit.startPreview()
+ } else {
+ agoraKit.stopPreview()
+ }
// start joining channel
// 1. Users can only see each other after they join the
diff --git a/macOS/APIExample/Examples/Basic/JoinChannelVideo(Recorder)/JoinChannelVideoRecorder.swift b/macOS/APIExample/Examples/Basic/JoinChannelVideo(Recorder)/JoinChannelVideoRecorder.swift
index ef9a37204..4d7712bb9 100644
--- a/macOS/APIExample/Examples/Basic/JoinChannelVideo(Recorder)/JoinChannelVideoRecorder.swift
+++ b/macOS/APIExample/Examples/Basic/JoinChannelVideo(Recorder)/JoinChannelVideoRecorder.swift
@@ -251,10 +251,16 @@ class JoinChannelVideoRecordMain: BaseViewController {
func initSelectRolePicker() {
selectRolePicker.label.stringValue = "Role".localized
selectRolePicker.picker.addItems(withTitles: roles.map { $0.description() })
- selectRolePicker.onSelectChanged {
- guard let selected = self.selectedRole else { return }
+ selectRolePicker.onSelectChanged { [weak self] in
+ guard let self = self, let selected = self.selectedRole else { return }
if self.isJoined {
+ let mediaOption = AgoraRtcChannelMediaOptions()
+ mediaOption.publishCameraTrack = selected == .broadcaster
+ mediaOption.publishMicrophoneTrack = selected == .broadcaster
+ mediaOption.clientRoleType = selected
+ self.agoraKit.updateChannel(with: mediaOption)
self.agoraKit.setClientRole(selected)
+ _ = selected == .broadcaster ? self.agoraKit.startPreview() : self.agoraKit.stopPreview()
}
}
}
@@ -421,7 +427,11 @@ class JoinChannelVideoRecordMain: BaseViewController {
videoCanvas.renderMode = .hidden
agoraKit.setupLocalVideo(videoCanvas)
// you have to call startPreview to see local video
- agoraKit.startPreview()
+ if role == .broadcaster {
+ agoraKit.startPreview()
+ } else {
+ agoraKit.stopPreview()
+ }
// start joining channel
// 1. Users can only see each other after they join the
diff --git a/macOS/APIExample/Examples/Basic/JoinChannelVideo(Token)/JoinChannelVideoToken.swift b/macOS/APIExample/Examples/Basic/JoinChannelVideo(Token)/JoinChannelVideoToken.swift
index 004899db1..7eb697809 100644
--- a/macOS/APIExample/Examples/Basic/JoinChannelVideo(Token)/JoinChannelVideoToken.swift
+++ b/macOS/APIExample/Examples/Basic/JoinChannelVideo(Token)/JoinChannelVideoToken.swift
@@ -215,10 +215,16 @@ class JoinChannelVideoToken: BaseViewController {
func initSelectRolePicker() {
selectRolePicker.label.stringValue = "Role".localized
selectRolePicker.picker.addItems(withTitles: roles.map { $0.description() })
- selectRolePicker.onSelectChanged {
- guard let selected = self.selectedRole else { return }
+ selectRolePicker.onSelectChanged { [weak self] in
+ guard let self = self, let selected = self.selectedRole else { return }
if self.isJoined {
+ let mediaOption = AgoraRtcChannelMediaOptions()
+ mediaOption.publishCameraTrack = selected == .broadcaster
+ mediaOption.publishMicrophoneTrack = selected == .broadcaster
+ mediaOption.clientRoleType = selected
+ self.agoraKit?.updateChannel(with: mediaOption)
self.agoraKit?.setClientRole(selected)
+ _ = selected == .broadcaster ? self.agoraKit?.startPreview() : self.agoraKit?.stopPreview()
}
}
}
@@ -355,7 +361,11 @@ class JoinChannelVideoToken: BaseViewController {
videoCanvas.renderMode = .hidden
agoraKit?.setupLocalVideo(videoCanvas)
// you have to call startPreview to see local video
- agoraKit?.startPreview()
+ if role == .broadcaster {
+ agoraKit?.startPreview()
+ } else {
+ agoraKit?.stopPreview()
+ }
// start joining channel
// 1. Users can only see each other after they join the
diff --git a/macOS/APIExample/Examples/Basic/JoinChannelVideo/JoinChannelVideo.swift b/macOS/APIExample/Examples/Basic/JoinChannelVideo/JoinChannelVideo.swift
index 30655fbbe..e5f9158dc 100644
--- a/macOS/APIExample/Examples/Basic/JoinChannelVideo/JoinChannelVideo.swift
+++ b/macOS/APIExample/Examples/Basic/JoinChannelVideo/JoinChannelVideo.swift
@@ -213,10 +213,16 @@ class JoinChannelVideoMain: BaseViewController {
func initSelectRolePicker() {
selectRolePicker.label.stringValue = "Role".localized
selectRolePicker.picker.addItems(withTitles: roles.map { $0.description() })
- selectRolePicker.onSelectChanged {
- guard let selected = self.selectedRole else { return }
+ selectRolePicker.onSelectChanged { [weak self] in
+ guard let self = self, let selected = self.selectedRole else { return }
if self.isJoined {
+ let mediaOption = AgoraRtcChannelMediaOptions()
+ mediaOption.publishCameraTrack = selected == .broadcaster
+ mediaOption.publishMicrophoneTrack = selected == .broadcaster
+ mediaOption.clientRoleType = selected
+ self.agoraKit.updateChannel(with: mediaOption)
self.agoraKit.setClientRole(selected)
+ _ = selected == .broadcaster ? self.agoraKit.startPreview() : self.agoraKit.stopPreview()
}
}
}
@@ -338,7 +344,11 @@ class JoinChannelVideoMain: BaseViewController {
videoCanvas.renderMode = .hidden
agoraKit.setupLocalVideo(videoCanvas)
// you have to call startPreview to see local video
- agoraKit.startPreview()
+ if role == .broadcaster {
+ agoraKit.startPreview()
+ } else {
+ agoraKit.stopPreview()
+ }
// start joining channel
// 1. Users can only see each other after they join the
diff --git a/macOS/Podfile b/macOS/Podfile
index 0295ed132..ce429cb69 100644
--- a/macOS/Podfile
+++ b/macOS/Podfile
@@ -4,14 +4,14 @@ target 'APIExample' do
use_frameworks!
pod 'AGEVideoLayout', '1.0.2'
- pod 'AgoraRtcEngine_macOS', '4.2.3'
+ pod 'AgoraRtcEngine_macOS', '4.2.6'
# pod 'sdk', :path => 'sdk.podspec'
end
target 'SimpleFilter' do
use_frameworks!
# pod 'sdk', :path => 'sdk.podspec'
- pod 'AgoraRtcEngine_macOS', '4.2.3'
+ pod 'AgoraRtcEngine_macOS', '4.2.6'
end
diff --git a/windows/APIExample/APIExample/APIExample.rc b/windows/APIExample/APIExample/APIExample.rc
index 71be7229d..1889b9bf7 100755
--- a/windows/APIExample/APIExample/APIExample.rc
+++ b/windows/APIExample/APIExample/APIExample.rc
@@ -245,7 +245,7 @@ BEGIN
EDITTEXT IDC_EDIT_CHANNELNAME,72,307,115,13,ES_AUTOHSCROLL
PUSHBUTTON "JoinChannel",IDC_BUTTON_JOINCHANNEL,194,306,50,14
LTEXT "lightening contrast",IDC_STATIC_BEAUTY_LIGHTENING_CONTRAST_LEVEL,12,334,64,8
- COMBOBOX IDC_COMBO_BEAUTE_LIGHTENING_CONTRAST_LEVEL,81,333,79,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_COMBO_BEAUTE_LIGHTENING_CONTRAST_LEVEL,71,333,79,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "",IDC_STATIC_DETAIL,498,341,132,56
LTEXT "lightening",IDC_STATIC_BEAUTY_LIGHTENING,12,351,45,8
LTEXT "redness",IDC_STATIC_BEAUTY_REDNESS,167,334,41,8
@@ -545,14 +545,18 @@ BEGIN
LTEXT "Channel Name",IDC_STATIC_CHANNELNAME,11,328,48,8
EDITTEXT IDC_EDIT_CHANNELNAME,70,326,218,13,ES_AUTOHSCROLL
PUSHBUTTON "JoinChannel",IDC_BUTTON_JOINCHANNEL,307,326,60,14
- LTEXT "",IDC_STATIC_DETAIL,442,325,181,58
+ LTEXT "",IDC_STATIC_DETAIL,525,325,98,58
LTEXT "video source",IDC_STATIC_VIDEO_SOURCE,11,347,48,8
- EDITTEXT IDC_EDIT_VIDEO_SOURCE,70,346,218,13,ES_AUTOHSCROLL
- PUSHBUTTON "open",IDC_BUTTON_OPEN,306,346,60,14
- PUSHBUTTON "stop",IDC_BUTTON_STOP,9,363,60,14
- PUSHBUTTON "play",IDC_BUTTON_PLAY,76,363,60,14
- PUSHBUTTON "publish mediaplayer",IDC_BUTTON_PUBLISH_VIDEO,148,363,74,14
+ EDITTEXT IDC_EDIT_VIDEO_SOURCE,69,345,218,13,ES_AUTOHSCROLL
+ PUSHBUTTON "open",IDC_BUTTON_OPEN,307,344,60,14
+ PUSHBUTTON "stop",IDC_BUTTON_STOP,9,361,60,14
+ PUSHBUTTON "play",IDC_BUTTON_PLAY,75,361,60,14
+ PUSHBUTTON "publish mediaplayer",IDC_BUTTON_PUBLISH_VIDEO,148,361,74,14
CONTROL "",IDC_SLIDER_VIDEO,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,377,355,15
+ LTEXT "PlayerStream",IDC_STATIC_PLAYER_STREAM,378,347,52,8
+ COMBOBOX IDC_COMBO_PLAYER_STREAM_INDEX,436,345,79,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "PublishStream",IDC_STATIC_PUBLISH_STREAM,378,364,52,8
+ COMBOBOX IDC_COMBO_PUBLISH_STREAM_INDEX,436,362,79,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_DIALOG_MUTI_CHANNEL DIALOGEX 0, 0, 632, 400
@@ -871,6 +875,8 @@ BEGIN
BEGIN
RIGHTMARGIN, 630
BOTTOMMARGIN, 397
+ HORZGUIDE, 351
+ HORZGUIDE, 368
END
IDD_DIALOG_MUTI_CHANNEL, DIALOG
diff --git a/windows/APIExample/APIExample/Advanced/AudioMixing/CAgoraAudioMixingDlg.cpp b/windows/APIExample/APIExample/Advanced/AudioMixing/CAgoraAudioMixingDlg.cpp
index 1b0c2d7cc..8685da2d4 100755
--- a/windows/APIExample/APIExample/Advanced/AudioMixing/CAgoraAudioMixingDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/AudioMixing/CAgoraAudioMixingDlg.cpp
@@ -99,8 +99,10 @@ void CAgoraAudioMixingDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/AudioProfile/CAgoraAudioProfile.cpp b/windows/APIExample/APIExample/Advanced/AudioProfile/CAgoraAudioProfile.cpp
index 99f5894d3..956ec9ac3 100644
--- a/windows/APIExample/APIExample/Advanced/AudioProfile/CAgoraAudioProfile.cpp
+++ b/windows/APIExample/APIExample/Advanced/AudioProfile/CAgoraAudioProfile.cpp
@@ -96,8 +96,10 @@ void CAgoraAudioProfile::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/AudioVolume/CAgoraAudioVolumeDlg.cpp b/windows/APIExample/APIExample/Advanced/AudioVolume/CAgoraAudioVolumeDlg.cpp
index b1b9ff922..f710936a3 100644
--- a/windows/APIExample/APIExample/Advanced/AudioVolume/CAgoraAudioVolumeDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/AudioVolume/CAgoraAudioVolumeDlg.cpp
@@ -117,8 +117,10 @@ void CAgoraAudioVolumeDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.cpp b/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.cpp
index a9c80a705..5d8f53b29 100755
--- a/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.cpp
+++ b/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.cpp
@@ -66,6 +66,7 @@ BEGIN_MESSAGE_MAP(CDlgBeauty, CDialogEx)
ON_BN_CLICKED(IDC_CHECK_VIDEO_DENOISE, &CDlgBeauty::OnBnClickedCheckVideoDenoise)
ON_BN_CLICKED(IDC_CHECK_VIDEO_DENOISE2, &CDlgBeauty::OnBnClickedCheckVideoDenoise2)
ON_BN_CLICKED(IDC_CHECK_LOWLIGHT, &CDlgBeauty::OnBnClickedCheckLowlight)
+ ON_WM_SHOWWINDOW()
ON_CONTROL_RANGE(BN_CLICKED, IDC_RADIO_VIRTUAL_BG_BLUR, IDC_RADIO_VIRTUAL_BG_IMAGE, &CDlgBeauty::OnBnClickedStaticVirtualBgChoose)
END_MESSAGE_MAP()
@@ -125,6 +126,20 @@ void CDlgBeauty::OnBnClickedButtonJoinchannel()
m_joinChannel = !m_joinChannel;
}
+void CDlgBeauty::OnShowWindow(BOOL bShow, UINT nStatus)
+{
+ CDialogEx::OnShowWindow(bShow, nStatus);
+
+ if (bShow) {
+ //init control text.
+ InitCtrlText();
+ }
+ else {
+ //resume window status.
+ ResumeStatus();
+ }
+}
+
bool CDlgBeauty::InitAgora()
{
//create Agora RTC engine
@@ -210,8 +225,11 @@ void CDlgBeauty::UnInitAgora()
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
+
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.h b/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.h
index eb8a11924..ebfa2ca18 100644
--- a/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.h
+++ b/windows/APIExample/APIExample/Advanced/Beauty/CDlgBeauty.h
@@ -130,4 +130,5 @@ class CDlgBeauty : public CDialogEx
afx_msg void OnBnClickedCheckLowlight();
afx_msg void OnBnClickedStaticVirtualBgChoose(UINT idCtl);
+ afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
};
diff --git a/windows/APIExample/APIExample/Advanced/BeautyAudio/CAgoraBeautyAudio.cpp b/windows/APIExample/APIExample/Advanced/BeautyAudio/CAgoraBeautyAudio.cpp
index eab1e5da6..d99f3930c 100644
--- a/windows/APIExample/APIExample/Advanced/BeautyAudio/CAgoraBeautyAudio.cpp
+++ b/windows/APIExample/APIExample/Advanced/BeautyAudio/CAgoraBeautyAudio.cpp
@@ -89,8 +89,10 @@ void CAgoraBeautyAudio::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp b/windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp
index 6d1a4b0a7..e9d38a987 100644
--- a/windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp
@@ -122,7 +122,7 @@ bool CAgoraCaptureAduioDlg::InitAgora()
//initialize the Agora RTC engine context.
int ret = m_rtcEngine->initialize(context);
- mediaEngine.queryInterface(m_rtcEngine, AGORA_IID_MEDIA_ENGINE);
+
if (ret != 0) {
m_initialize = false;
@@ -133,6 +133,8 @@ bool CAgoraCaptureAduioDlg::InitAgora()
}
else
m_initialize = true;
+
+ mediaEngine.queryInterface(m_rtcEngine, AGORA_IID_MEDIA_ENGINE);
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success"));
//enable video in the engine.
m_rtcEngine->enableVideo();
@@ -170,8 +172,10 @@ void CAgoraCaptureAduioDlg::UnInitAgora()
m_agAudioCaptureDevice.Stop();
m_agAudioCaptureDevice.engine_ = NULL;
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
@@ -555,7 +559,7 @@ void CAgoraCaptureAduioDlg::UpdateDevice()
nPathLen = MAX_PATH;
m_cmbAudioDevice.ResetContent();
//enum audio capture device.
- if (m_agAudioCaptureDevice.EnumDeviceList())
+ if (m_initialize && m_agAudioCaptureDevice.EnumDeviceList())
{
m_agAudioCaptureDevice.GetCurrentDevice(szDevicePath, &nPathLen);
for (int nIndex = 0; nIndex < m_agAudioCaptureDevice.GetDeviceCount(); nIndex++) {
diff --git a/windows/APIExample/APIExample/Advanced/CustomEncrypt/CAgoraCustomEncryptDlg.cpp b/windows/APIExample/APIExample/Advanced/CustomEncrypt/CAgoraCustomEncryptDlg.cpp
index f7bcf0a62..26acb77bc 100755
--- a/windows/APIExample/APIExample/Advanced/CustomEncrypt/CAgoraCustomEncryptDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/CustomEncrypt/CAgoraCustomEncryptDlg.cpp
@@ -109,8 +109,10 @@ void CAgoraCustomEncryptDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/LocalVideoTranscoding/CLocalVideoTranscodingDlg.cpp b/windows/APIExample/APIExample/Advanced/LocalVideoTranscoding/CLocalVideoTranscodingDlg.cpp
index 29e40aea8..c942eddfd 100755
--- a/windows/APIExample/APIExample/Advanced/LocalVideoTranscoding/CLocalVideoTranscodingDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/LocalVideoTranscoding/CLocalVideoTranscodingDlg.cpp
@@ -325,8 +325,10 @@ void CLocalVideoTranscodingDlg::UnInitAgora()
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/MediaEncrypt/CAgoraMediaEncryptDlg.cpp b/windows/APIExample/APIExample/Advanced/MediaEncrypt/CAgoraMediaEncryptDlg.cpp
index 9037a33e0..6bbf0d102 100755
--- a/windows/APIExample/APIExample/Advanced/MediaEncrypt/CAgoraMediaEncryptDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/MediaEncrypt/CAgoraMediaEncryptDlg.cpp
@@ -111,8 +111,10 @@ void CAgoraMediaEncryptDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.cpp b/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.cpp
index 11e62348c..b3fac38fc 100755
--- a/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.cpp
+++ b/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.cpp
@@ -22,6 +22,10 @@ void CAgoraMediaPlayer::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_LIST_INFO_BROADCASTING, m_lstInfo);
DDX_Control(pDX, IDC_STATIC_DETAIL, m_staDetail);
DDX_Control(pDX, IDC_STATIC_CHANNELNAME, m_staChannel);
+ DDX_Control(pDX, IDC_STATIC_PUBLISH_STREAM, m_staPublishStream);
+ DDX_Control(pDX, IDC_STATIC_PLAYER_STREAM, m_staPlayerStream);
+ DDX_Control(pDX, IDC_COMBO_PLAYER_STREAM_INDEX, m_cmbPlayerStream);
+ DDX_Control(pDX, IDC_COMBO_PUBLISH_STREAM_INDEX, m_cmbPublishStream);
DDX_Control(pDX, IDC_EDIT_CHANNELNAME, m_edtChannel);
DDX_Control(pDX, IDC_BUTTON_JOINCHANNEL, m_btnJoinChannel);
DDX_Control(pDX, IDC_STATIC_VIDEO_SOURCE, m_staVideoSource);
@@ -46,13 +50,15 @@ void CAgoraMediaPlayer::InitCtrlText()
m_btnPublishVideo.SetWindowText(mediaPlayerCtrlPublishVideo);
m_staChannel.SetWindowText(commonCtrlChannel);
m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel);
+ m_staPublishStream.SetWindowText(mediaPlayerCtrlPublishStream);
+ m_staPlayerStream.SetWindowText(mediaPlayerCtrlPlayerStream);
}
//Initialize media player.
void CAgoraMediaPlayer::InitMediaPlayerKit()
{
//create agora media player.
- m_mediaPlayer = m_rtcEngine->createMediaPlayer().get();//createAgoraMediaPlayer();
+ m_mediaPlayer = m_rtcEngine->createMediaPlayer();//createAgoraMediaPlayer();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("createAgoraMediaPlayer"));
//agora::rtc::MediaPlayerContext context;
//initialize media player context.
@@ -128,6 +134,9 @@ void CAgoraMediaPlayer::UnInitAgora()
if (m_joinChannel)
//leave channel
m_joinChannel = !m_rtcEngine->leaveChannel();
+
+ m_mediaPlayer->Release();
+ m_mediaPlayer = NULL;
//stop preview in the engine.
m_rtcEngine->stopPreview();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopPreview"));
@@ -135,8 +144,10 @@ void CAgoraMediaPlayer::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
@@ -155,6 +166,10 @@ void CAgoraMediaPlayer::ResumeStatus()
m_btnPublishVideo.EnableWindow(FALSE);
m_btnPlay.EnableWindow(FALSE);
+ m_staPublishStream.ShowWindow(FALSE);
+ m_staPlayerStream.ShowWindow(FALSE);
+ m_cmbPlayerStream.ShowWindow(FALSE);
+ m_cmbPublishStream.ShowWindow(FALSE);
m_mediaPlayerState = mediaPLAYER_READY;
m_joinChannel = false;
m_initialize = false;
@@ -180,6 +195,9 @@ BEGIN_MESSAGE_MAP(CAgoraMediaPlayer, CDialogEx)
ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraMediaPlayer::OnEIDUserJoined)
ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraMediaPlayer::OnEIDUserOffline)
ON_MESSAGE(WM_MSGID(mediaPLAYER_EVENT), &CAgoraMediaPlayer::OnEIDPlayerEvent)
+
+ ON_CBN_SELCHANGE(IDC_COMBO_PUBLISH_STREAM_INDEX, &CAgoraMediaPlayer::OnSelchangeComboPublishOrPlayerStream)
+ ON_CBN_SELCHANGE(IDC_COMBO_PLAYER_STREAM_INDEX, &CAgoraMediaPlayer::OnSelchangeComboPublishOrPlayerStream)
ON_WM_DESTROY()
ON_WM_HSCROLL()
@@ -259,18 +277,21 @@ void CAgoraMediaPlayer::OnBnClickedButtonOpen()
CString strInfo;
m_edtVideoSource.GetWindowText(strUrl);
std::string tmp = cs2utf8(strUrl);
+ MediaSource mediaSource;
switch (m_mediaPlayerState)
{
case mediaPLAYER_READY:
case mediaPLAYER_STOP:
-
if (tmp.empty())
{
AfxMessageBox(_T("you can fill video source."));
return;
}
//call media player open function
- m_mediaPlayer->open(tmp.c_str(), 0);
+ mediaSource.url = tmp.c_str();
+ mediaSource.enableMultiAudioTrack = TRUE;
+ mediaSource.autoPlay = FALSE;
+ m_mediaPlayer->openWithMediaSource(mediaSource);
break;
default:
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("can not open player."));
@@ -403,6 +424,37 @@ LRESULT CAgoraMediaPlayer::OnmediaPlayerStateChanged(WPARAM wParam, LPARAM lPara
m_mediaPlayer->getDuration(duration);
m_sldVideo.SetRangeMax((int)duration);
+ // get aduio stream list
+ audioStreams.clear();
+ int64_t streamCount;
+ m_mediaPlayer->getStreamCount(streamCount);
+ for (int i = 0; i < streamCount; i++) {
+ PlayerStreamInfo streamInfo;
+ m_mediaPlayer->getStreamInfo(i, &streamInfo);
+ if (streamInfo.streamType == MEDIA_STREAM_TYPE::STREAM_TYPE_AUDIO) {
+ audioStreams.push_back(streamInfo.streamIndex);
+ }
+ }
+
+ if (audioStreams.size() > 0) {
+ m_staPublishStream.ShowWindow(TRUE);
+ m_staPlayerStream.ShowWindow(TRUE);
+ m_cmbPublishStream.ShowWindow(TRUE);
+ m_cmbPlayerStream.ShowWindow(TRUE);
+ m_cmbPublishStream.ResetContent();
+ m_cmbPlayerStream.ResetContent();
+
+ for (int i = 0; i < audioStreams.size(); i++) {
+ CString strInfo;
+ strInfo.Format(_T("AudioStream %d"), i);
+ m_cmbPublishStream.AddString(strInfo);
+ m_cmbPlayerStream.AddString(strInfo);
+ }
+
+ m_cmbPublishStream.SetCurSel(0);
+ m_cmbPlayerStream.SetCurSel(0);
+ }
+
break;
case agora::media::base::PLAYER_STATE_OPENING:
strState = _T("PLAYER_STATE_OPENING");
@@ -430,6 +482,11 @@ LRESULT CAgoraMediaPlayer::OnmediaPlayerStateChanged(WPARAM wParam, LPARAM lPara
if (m_publishMeidaplayer) {
ToggleMediaPlayerPublish();
}
+ m_staPublishStream.ShowWindow(FALSE);
+ m_staPlayerStream.ShowWindow(FALSE);
+ m_cmbPublishStream.ShowWindow(FALSE);
+ m_cmbPlayerStream.ShowWindow(FALSE);
+
break;
case agora::media::base::PLAYER_STATE_FAILED:
strState = _T("PLAYER_STATE_FAILED");
@@ -559,7 +616,6 @@ LRESULT CAgoraMediaPlayer::OnEIDPlayerEvent(WPARAM wParam, LPARAM lParam) {
case PLAYER_EVENT_SEEK_ERROR:
strInfo = _T("PLAYER_EVENT_SEEK_ERROR");
break;
-
case PLAYER_EVENT_AUDIO_TRACK_CHANGED:
strInfo = _T("PLAYER_EVENT_AUDIO_TRACK_CHANGED");
break;
@@ -681,3 +737,17 @@ void CAgoraMediaPlayer::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBa
//m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
}
}
+
+
+void CAgoraMediaPlayer::OnSelchangeComboPublishOrPlayerStream()
+{
+ int playerStream = audioStreams[m_cmbPlayerStream.GetCurSel()];
+ int publishStream = audioStreams[m_cmbPublishStream.GetCurSel()];
+ int ret = m_mediaPlayer->selectMultiAudioTrack(playerStream, publishStream);
+
+ CString strInfo;
+ strInfo.Format(_T("selectMultiAudioTrack playerStream:%d, publishStream:%d, ret:%d"), playerStream, publishStream, ret);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
+}
+
+
diff --git a/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.h b/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.h
index f9be34a86..aa7002e6d 100755
--- a/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.h
+++ b/windows/APIExample/APIExample/Advanced/MediaPlayer/CAgoraMediaPlayer.h
@@ -37,9 +37,9 @@ class CMediaPlayerSourceObserver : public IMediaPlayerSourceObserver {
*
* @param position Current playback progress (ms).
*/
- virtual void onPositionChanged(int64_t position)
+ virtual void onPositionChanged(int64_t positionMs, int64_t timestampMs)
{
- ::PostMessage(m_hMsgHanlder, WM_MSGID(mediaPLAYER_POSTION_CHANGED), (WPARAM)new int64_t(position), NULL);
+ ::PostMessage(m_hMsgHanlder, WM_MSGID(mediaPLAYER_POSTION_CHANGED), (WPARAM)new int64_t(positionMs), NULL);
}
/**
* Reports the playback event.
@@ -224,12 +224,13 @@ class CAgoraMediaPlayer : public CDialogEx
bool m_publishAudio = false;
bool m_publishMeidaplayer = false;
bool m_isVideoSliderCapturing = false;
+ std::vector audioStreams;
IRtcEngine* m_rtcEngine = nullptr;
CAGVideoWnd m_localVideoWnd;
CAgoraMediaPlayerHandler m_eventHandler;
CMediaPlayerSourceObserver m_mediaPlayerEvent;
- IMediaPlayer *m_mediaPlayer = nullptr;
+ agora_refptr m_mediaPlayer = nullptr;
MEDIAPLAYERSTATE m_mediaPlayerState = mediaPLAYER_READY;
//AgoraRtcChannelPublishHelper m_rtcChannelPublishHelper;
protected:
@@ -248,6 +249,10 @@ class CAgoraMediaPlayer : public CDialogEx
CListBox m_lstInfo;
CStatic m_staDetail;
CStatic m_staChannel;
+ CStatic m_staPublishStream;
+ CStatic m_staPlayerStream;
+ CComboBox m_cmbPublishStream;
+ CComboBox m_cmbPlayerStream;
CEdit m_edtChannel;
CButton m_btnJoinChannel;
CStatic m_staVideoSource;
@@ -271,4 +276,5 @@ class CAgoraMediaPlayer : public CDialogEx
afx_msg void OnSelchangeListInfoBroadcasting();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+ afx_msg void OnSelchangeComboPublishOrPlayerStream();
};
diff --git a/windows/APIExample/APIExample/Advanced/MediaRecorder/CAgoraMediaRecorder.cpp b/windows/APIExample/APIExample/Advanced/MediaRecorder/CAgoraMediaRecorder.cpp
index fbdfbc27f..8845174c0 100755
--- a/windows/APIExample/APIExample/Advanced/MediaRecorder/CAgoraMediaRecorder.cpp
+++ b/windows/APIExample/APIExample/Advanced/MediaRecorder/CAgoraMediaRecorder.cpp
@@ -134,8 +134,10 @@ void CAgoraMediaRecorder::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/MultiChannel/CAgoraMultiChannelDlg.cpp b/windows/APIExample/APIExample/Advanced/MultiChannel/CAgoraMultiChannelDlg.cpp
index 534916376..98795e84a 100755
--- a/windows/APIExample/APIExample/Advanced/MultiChannel/CAgoraMultiChannelDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/MultiChannel/CAgoraMultiChannelDlg.cpp
@@ -132,8 +132,10 @@ void CAgoraMultiChannelDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/MultiVideoSource/CAgoraMutilVideoSourceDlg.cpp b/windows/APIExample/APIExample/Advanced/MultiVideoSource/CAgoraMutilVideoSourceDlg.cpp
index c4f39dcea..1cd31a2de 100755
--- a/windows/APIExample/APIExample/Advanced/MultiVideoSource/CAgoraMutilVideoSourceDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/MultiVideoSource/CAgoraMutilVideoSourceDlg.cpp
@@ -369,8 +369,10 @@ void CAgoraMutilVideoSourceDlg::UnInitAgora()
m_rtcEngine->stopPreview();
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/MultiVideoSourceTracks/MultiVideoSourceTracks.cpp b/windows/APIExample/APIExample/Advanced/MultiVideoSourceTracks/MultiVideoSourceTracks.cpp
index 0fa7987d8..ea48592e8 100755
--- a/windows/APIExample/APIExample/Advanced/MultiVideoSourceTracks/MultiVideoSourceTracks.cpp
+++ b/windows/APIExample/APIExample/Advanced/MultiVideoSourceTracks/MultiVideoSourceTracks.cpp
@@ -322,8 +322,10 @@ void MultiVideoSourceTracks::UnInitAgora()
m_rtcEngine->stopPreview();
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.cpp b/windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.cpp
index 8ae0b2fdf..13f15d4d7 100755
--- a/windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.cpp
@@ -226,8 +226,10 @@ void CAgoraOriginalAudioDlg::UnInitAgora()
bRegisterEncoded = false;
}
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/OriginalVideo/CAgoraOriginalVideoDlg.cpp b/windows/APIExample/APIExample/Advanced/OriginalVideo/CAgoraOriginalVideoDlg.cpp
index 275254d64..52b108f72 100755
--- a/windows/APIExample/APIExample/Advanced/OriginalVideo/CAgoraOriginalVideoDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/OriginalVideo/CAgoraOriginalVideoDlg.cpp
@@ -83,8 +83,10 @@ void CAgoraOriginalVideoDlg::UnInitAgora()
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
RegisterVideoFrameObserver(FALSE);
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.cpp b/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.cpp
index 00d30c2ff..a093fed4e 100755
--- a/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.cpp
@@ -82,7 +82,16 @@ bool CAgoraPreCallTestDlg::InitAgora()
context.eventHandler = &m_eventHandler;
//initialize the Agora RTC engine context.
int ret = m_rtcEngine->initialize(context);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize rtc engine"));
+ if (ret != 0) {
+ m_initialize = false;
+ CString strInfo;
+ strInfo.Format(_T("initialize failed: %d"), ret);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
+ return false;
+ }
+ else
+ m_initialize = true;
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("initialize success"));
LastmileProbeConfig config;
config.probeUplink = true;
config.probeDownlink = true;
@@ -106,14 +115,22 @@ bool CAgoraPreCallTestDlg::InitAgora()
void CAgoraPreCallTestDlg::UnInitAgora()
{
if (m_rtcEngine) {
- //release device manager.
- m_audioDeviceManager->release();
- m_videoDeviceManager->release();
+
m_rtcEngine->stopLastmileProbeTest();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("stopLastmileProbeTest"));
- //release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+
+ if (m_initialize) {
+ //release device manager.
+ m_audioDeviceManager->release();
+ m_videoDeviceManager->release();
+
+ //release engine.
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
+
+ m_audioDeviceManager = NULL;
+ m_videoDeviceManager = NULL;
m_rtcEngine = NULL;
}
}
@@ -146,6 +163,9 @@ void CAgoraPreCallTestDlg::UpdateViews()
m_cmbAudioInput.ResetContent();
m_cmbAudioOutput.ResetContent();
m_cmbVideo.ResetContent();
+ if (!m_initialize) {
+ return;
+ }
int nVol;
(*m_audioDeviceManager)->getPlaybackDeviceVolume(&nVol);
m_sldAudioOutputVol.SetPos(nVol);
diff --git a/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.h b/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.h
index 0ab105f28..9499b30b7 100644
--- a/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.h
+++ b/windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.h
@@ -99,6 +99,7 @@ class CAgoraPreCallTestDlg : public CDialogEx
bool m_audioInputTest;
bool m_audioOutputTest;
bool m_cameraTest;
+ bool m_initialize;
protected:
virtual void DoDataExchange(CDataExchange* pDX);
diff --git a/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.cpp b/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.cpp
index a5a8d6955..977f862a6 100755
--- a/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.cpp
+++ b/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.cpp
@@ -120,7 +120,11 @@ void PushExternalVideoYUV::UnInitAgora()
{
if (m_rtcEngine) {
yuvReader.stop();
- delete m_imgBuffer;
+ if (m_imgBuffer) {
+ delete m_imgBuffer;
+ m_imgBuffer = nullptr;
+ }
+
if (m_joinChannel)
m_joinChannel = !m_rtcEngine->leaveChannel();
@@ -134,8 +138,10 @@ void PushExternalVideoYUV::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.h b/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.h
index 0fbb9a409..c44640556 100755
--- a/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.h
+++ b/windows/APIExample/APIExample/Advanced/PushExternalVideoYUV/PushExternalVideoYUV.h
@@ -123,7 +123,7 @@ class PushExternalVideoYUV : public CDialogEx
agora::util::AutoPtr m_mediaEngine;
bool m_joinChannel = false;
bool m_initialize = false;
- BYTE* m_imgBuffer;
+ BYTE* m_imgBuffer = nullptr;
DECLARE_MESSAGE_MAP()
diff --git a/windows/APIExample/APIExample/Advanced/RTMPStream/AgoraRtmpStreaming.cpp b/windows/APIExample/APIExample/Advanced/RTMPStream/AgoraRtmpStreaming.cpp
index b1e3c5089..ed2712fae 100755
--- a/windows/APIExample/APIExample/Advanced/RTMPStream/AgoraRtmpStreaming.cpp
+++ b/windows/APIExample/APIExample/Advanced/RTMPStream/AgoraRtmpStreaming.cpp
@@ -248,8 +248,10 @@ void CAgoraRtmpStreamingDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/RegionConn/CAgoraRegionConnDlg.cpp b/windows/APIExample/APIExample/Advanced/RegionConn/CAgoraRegionConnDlg.cpp
index ed5d2fd25..fa9d1963b 100644
--- a/windows/APIExample/APIExample/Advanced/RegionConn/CAgoraRegionConnDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/RegionConn/CAgoraRegionConnDlg.cpp
@@ -167,8 +167,10 @@ void CAgoraRegionConnDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp b/windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp
index d4f9a87e5..153bcc58c 100755
--- a/windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp
+++ b/windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp
@@ -123,8 +123,10 @@ void CAgoraScreenCapture::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
if (m_screenParam.excludeWindowList != nullptr) {
delete[] m_screenParam.excludeWindowList;
@@ -352,7 +354,9 @@ void CAgoraScreenCapture::OnBnClickedButtonStartShare()
if (!m_rtcEngine || !m_initialize)
return;
HWND hWnd = NULL;
- //if (m_cmbScreenCap.GetCurSel() != m_cmbScreenCap.GetCount() - 1)
+ if (m_cmbScreenCap.GetCurSel() < 0 || m_cmbScreenCap.GetCurSel() >= m_listWnd.GetSize()) {
+ return;
+ }
hWnd = (HWND)m_listWnd.GetAt(m_listWnd.FindIndex(m_cmbScreenCap.GetCurSel())).sourceId;
int ret = 0;
m_windowShare = !m_windowShare;
diff --git a/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.cpp b/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.cpp
index 27551f910..581b4a3c5 100755
--- a/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.cpp
@@ -185,10 +185,14 @@ bool CAgoraSpatialAudioDlg::InitAgora()
void CAgoraSpatialAudioDlg::UnInitAgora()
{
if (m_rtcEngine) {
- m_mediaPlayerLeft->stop();
- m_mediaPlayerLeft = nullptr;
- m_mediaPlayerRight->stop();
- m_mediaPlayerRight = nullptr;
+ if (m_mediaPlayerLeft) {
+ m_mediaPlayerLeft->stop();
+ m_mediaPlayerLeft = nullptr;
+ }
+ if (m_mediaPlayerRight) {
+ m_mediaPlayerRight->stop();
+ m_mediaPlayerRight = nullptr;
+ }
m_localSpatial = nullptr;
if (m_joinChannel)
@@ -201,8 +205,10 @@ void CAgoraSpatialAudioDlg::UnInitAgora()
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableAudio"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.h b/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.h
index fdd870bf5..39aaae7c5 100755
--- a/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.h
+++ b/windows/APIExample/APIExample/Advanced/SpatialAudio/CAgoraSpatialAudioDlg.h
@@ -47,10 +47,12 @@ class CSpatialAudioPlayerObserver : public IMediaPlayerSourceObserver {
*
* @param position Current playback progress (ms).
*/
- virtual void onPositionChanged(int64_t position)
+ virtual void onPositionChanged(int64_t positionMs, int64_t timestampMs)
{
}
+
+
/**
* Reports the playback event.
*
@@ -123,6 +125,8 @@ class CSpatialAudioPlayerObserver : public IMediaPlayerSourceObserver {
virtual void onAudioVolumeIndication(int volume)override {
}
+
+
private:
IMediaPlayer *m_player;
};
@@ -253,10 +257,10 @@ class CAgoraSpatialAudioDlg : public CDialogEx
bool m_SpatialAudio = false;
IRtcEngine* m_rtcEngine = nullptr;
- ILocalSpatialAudioEngine* m_localSpatial;
- IMediaPlayer* m_mediaPlayerLeft;
+ ILocalSpatialAudioEngine* m_localSpatial = nullptr;
+ IMediaPlayer* m_mediaPlayerLeft = nullptr;
CSpatialAudioPlayerObserver playerLeftObserver;
- IMediaPlayer* m_mediaPlayerRight;
+ IMediaPlayer* m_mediaPlayerRight = nullptr;
CSpatialAudioPlayerObserver playerRightObserver;
CSpatialAudioEventHandler m_eventHandler;
diff --git a/windows/APIExample/APIExample/Advanced/VideoMetadata/CAgoraMetaDataDlg.cpp b/windows/APIExample/APIExample/Advanced/VideoMetadata/CAgoraMetaDataDlg.cpp
index 3c1f81ec0..a0b317209 100755
--- a/windows/APIExample/APIExample/Advanced/VideoMetadata/CAgoraMetaDataDlg.cpp
+++ b/windows/APIExample/APIExample/Advanced/VideoMetadata/CAgoraMetaDataDlg.cpp
@@ -340,8 +340,10 @@ void CAgoraMetaDataDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp b/windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp
index a40098a81..d0af2c34c 100755
--- a/windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp
+++ b/windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp
@@ -370,8 +370,10 @@ void CLiveBroadcastingDlg::UnInitAgora()
m_rtcEngine->disableVideo();
m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("disableVideo"));
//release engine.
- m_rtcEngine->release(true);
- m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ if (m_initialize) {
+ m_rtcEngine->release(true);
+ m_lstInfo.InsertString(m_lstInfo.GetCount(), _T("release rtc engine"));
+ }
m_rtcEngine = NULL;
}
}
diff --git a/windows/APIExample/APIExample/Language.h b/windows/APIExample/APIExample/Language.h
index 6788508bd..ea648389c 100755
--- a/windows/APIExample/APIExample/Language.h
+++ b/windows/APIExample/APIExample/Language.h
@@ -216,19 +216,6 @@ extern wchar_t OriginalAudioCtrlProc[INFO_LEN];
extern wchar_t OriginalAudioCtrlSetProc[INFO_LEN];
extern wchar_t OriginalAudioCtrlUnSetProc[INFO_LEN];
-//media player
-extern wchar_t MeidaPlayerCtrlVideoSource[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlOpen[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlClose[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlPause[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlPlay[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlAttachPlayer[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlDettachPlayer[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlPublishVideo[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlUnPublishVideo[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlPublishAudio[INFO_LEN];
-extern wchar_t MeidaPlayerCtrlUnPublishAudio[INFO_LEN];
-
//multi channel
extern wchar_t MultiChannelCtrlChannelList[INFO_LEN];
@@ -320,6 +307,8 @@ extern wchar_t mediaPlayerCtrlPublishVideo[INFO_LEN];
extern wchar_t mediaPlayerCtrlUnPublishVideo[INFO_LEN];
extern wchar_t mediaPlayerCtrlPublishAudio[INFO_LEN];
extern wchar_t mediaPlayerCtrlUnPublishAudio[INFO_LEN];
+extern wchar_t mediaPlayerCtrlPublishStream[INFO_LEN];
+extern wchar_t mediaPlayerCtrlPlayerStream[INFO_LEN];
extern wchar_t liveBraodcastingReport[INFO_LEN];
diff --git a/windows/APIExample/APIExample/en.ini b/windows/APIExample/APIExample/en.ini
index e299c6ceb..7054d6544 100755
--- a/windows/APIExample/APIExample/en.ini
+++ b/windows/APIExample/APIExample/en.ini
@@ -185,17 +185,19 @@ MediaEncrypt.Ctrl.SetEncrypt=Set Encrypt
-MeidaPlayer.Ctrl.VideoSource=VideoSource
-MeidaPlayer.Ctrl.Open=Open
-MeidaPlayer.Ctrl.Close=Close
-MeidaPlayer.Ctrl.Pause=Pause
-MeidaPlayer.Ctrl.Play=Play
-MeidaPlayer.Ctrl.AttachPlayer=AttachPlayer
-MeidaPlayer.Ctrl.DettachPlayer=DettachPlayer
-MeidaPlayer.Ctrl.PublishVideo=Publish MediaPlayer
-MeidaPlayer.Ctrl.UnPublishVideo=UnPublishVideo
-MeidaPlayer.Ctrl.PublishAudio=PublishAudio
-MeidaPlayer.Ctrl.UnPublishAudio=UnPublishAudio
+mediaPlayer.Ctrl.VideoSource=VideoSource
+mediaPlayer.Ctrl.Open=Open
+mediaPlayer.Ctrl.Close=Close
+mediaPlayer.Ctrl.Pause=Pause
+mediaPlayer.Ctrl.Play=Play
+mediaPlayer.Ctrl.AttachPlayer=AttachPlayer
+mediaPlayer.Ctrl.DettachPlayer=DettachPlayer
+mediaPlayer.Ctrl.PublishVideo=Publish MediaPlayer
+mediaPlayer.Ctrl.UnPublishVideo=UnPublishVideo
+mediaPlayer.Ctrl.PublishAudio=PublishAudio
+mediaPlayer.Ctrl.UnPublishAudio=UnPublishAudio
+mediaPlayer.Ctrl.PublishStream=PublishStream
+mediaPlayer.Ctrl.PlayerStream=PlayerStream
MultiChannel.Ctrl.ChannelList=Channel List
diff --git a/windows/APIExample/APIExample/resource.h b/windows/APIExample/APIExample/resource.h
index 87fa16f62..08aa0ee7a 100755
--- a/windows/APIExample/APIExample/resource.h
+++ b/windows/APIExample/APIExample/resource.h
@@ -142,7 +142,10 @@
#define IDC_COMBO_BEAUTE_LIGHTENING_CONTRAST_LEVEL 1050
#define IDC_BUTTON_HWND_EXECLUDE 1050
#define IDC_STATIC_BEAUTY_REDNESS 1051
+#define IDC_STATIC_BEAUTY_LIGHTENING_CONTRAST_LEVEL2 1051
+#define IDC_STATIC_PUBLISH_STREAM 1051
#define IDC_STATIC_BEAUTY_SMOOTHNESS 1052
+#define IDC_COMBO_PUBLISH_STREAM_INDEX 1052
#define IDC_CHECK1 1054
#define IDC_CHECK_BEAUTY_ENABLE 1054
#define IDC_CHK_ONLY_LOCAL 1054
@@ -373,7 +376,9 @@
#define IDC_COMBO_AREA_CODE 1147
#define IDC_STATIC_LOCAL_VIDEO_FPS_VAL 1148
#define IDC_STATIC_CROSS_CHANNEL 1148
+#define IDC_COMBO_PLAYER_STREAM_INDEX 1148
#define IDC_EDIT_CROSS_CHANNEL 1149
+#define IDC_STATIC_PLAYER_STREAM 1149
#define IDC_EDIT_TOKEN 1150
#define IDC_STATIC_TOKEN 1151
#define IDC_USER_ID 1152
@@ -400,7 +405,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 173
#define _APS_NEXT_COMMAND_VALUE 32771
-#define _APS_NEXT_CONTROL_VALUE 1148
+#define _APS_NEXT_CONTROL_VALUE 1150
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/windows/APIExample/APIExample/stdafx.cpp b/windows/APIExample/APIExample/stdafx.cpp
index e15a03b6d..ad5e0f3ba 100755
--- a/windows/APIExample/APIExample/stdafx.cpp
+++ b/windows/APIExample/APIExample/stdafx.cpp
@@ -186,19 +186,6 @@ wchar_t mediaEncryptCtrlSecret[INFO_LEN];
wchar_t mediaEncryptCtrlSetEncrypt[INFO_LEN];
-//media player
-wchar_t MeidaPlayerCtrlVideoSource[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlOpen[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlClose[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlPause[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlPlay[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlAttachPlayer[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlDettachPlayer[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlPublishVideo[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlUnPublishVideo[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlPublishAudio[INFO_LEN] = { 0 };
-wchar_t MeidaPlayerCtrlUnPublishAudio[INFO_LEN] = { 0 };
-
//multi channel
wchar_t MultiChannelCtrlChannelList[INFO_LEN] = { 0 };
wchar_t MultiChannelCtrlJoinExChannel[INFO_LEN] = { 0 };
@@ -291,6 +278,10 @@ wchar_t mediaPlayerCtrlPublishVideo[INFO_LEN] = { 0 };
wchar_t mediaPlayerCtrlUnPublishVideo[INFO_LEN] = { 0 };
wchar_t mediaPlayerCtrlPublishAudio[INFO_LEN] = { 0 };
wchar_t mediaPlayerCtrlUnPublishAudio[INFO_LEN] = { 0 };
+wchar_t mediaPlayerCtrlPublishStream[INFO_LEN] = { 0 };
+wchar_t mediaPlayerCtrlPlayerStream[INFO_LEN] = { 0 };
+
+// live broadcasting
wchar_t liveBraodcastingReport[INFO_LEN] = { 0 };
wchar_t liveBraodcastingModeration[INFO_LEN] = { 0 };
wchar_t liveBraodcastingEncode[INFO_LEN] = { 0 };
@@ -643,19 +634,6 @@ void InitKeyInfomation()
_tcscpy_s(mediaEncryptCtrlSecret, INFO_LEN, Str(_T("MediaEncrypt.Ctrl.Secret")));
_tcscpy_s(mediaEncryptCtrlSetEncrypt, INFO_LEN, Str(_T("MediaEncrypt.Ctrl.SetEncrypt")));
- //media player
- _tcscpy_s(MeidaPlayerCtrlVideoSource, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.VideoSource")));
- _tcscpy_s(MeidaPlayerCtrlOpen, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.Open")));
- _tcscpy_s(MeidaPlayerCtrlClose, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.Close")));
- _tcscpy_s(MeidaPlayerCtrlPause, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.Pause")));
- _tcscpy_s(MeidaPlayerCtrlPlay, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.Play")));
- _tcscpy_s(MeidaPlayerCtrlAttachPlayer, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.AttachPlayer")));
- _tcscpy_s(MeidaPlayerCtrlDettachPlayer, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.DettachPlayer")));
- _tcscpy_s(MeidaPlayerCtrlPublishVideo, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.PublishVideo")));
- _tcscpy_s(MeidaPlayerCtrlUnPublishVideo, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.UnPublishVideo")));
- _tcscpy_s(MeidaPlayerCtrlPublishAudio, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.PublishAudio")));
- _tcscpy_s(MeidaPlayerCtrlUnPublishAudio, INFO_LEN, Str(_T("MeidaPlayer.Ctrl.UnPublishAudio")));
-
//multichannel
_tcscpy_s(MultiChannelCtrlChannelList, INFO_LEN, Str(_T("MultiChannel.Ctrl.ChannelList")));
_tcscpy_s(MultiChannelCtrlJoinExChannel, INFO_LEN, Str(_T("MultiChannel.Ctrl.JoinExChannel")));
@@ -718,6 +696,8 @@ void InitKeyInfomation()
_tcscpy_s(mediaPlayerCtrlUnPublishVideo, INFO_LEN, Str(_T("mediaPlayer.Ctrl.UnPublishVideo")));
_tcscpy_s(mediaPlayerCtrlPublishAudio, INFO_LEN, Str(_T("mediaPlayer.Ctrl.PublishAudio")));
_tcscpy_s(mediaPlayerCtrlUnPublishAudio, INFO_LEN, Str(_T("mediaPlayer.Ctrl.UnPublishAudio")));
+ _tcscpy_s(mediaPlayerCtrlPlayerStream, INFO_LEN, Str(_T("mediaPlayer.Ctrl.PlayerStream")));
+ _tcscpy_s(mediaPlayerCtrlPublishStream, INFO_LEN, Str(_T("mediaPlayer.Ctrl.PublishStream")));
//beauty audio
_tcscpy_s(beautyAudioCtrlChange, INFO_LEN, Str(_T("BeautyAudio.Ctrl.Change")));
diff --git a/windows/APIExample/APIExample/zh-cn.ini b/windows/APIExample/APIExample/zh-cn.ini
index 5970d90f5..3e6952a75 100755
--- a/windows/APIExample/APIExample/zh-cn.ini
+++ b/windows/APIExample/APIExample/zh-cn.ini
@@ -167,20 +167,6 @@ MediaEncrypt.Ctrl.Mode=ģʽ
MediaEncrypt.Ctrl.Secret=
MediaEncrypt.Ctrl.SetEncrypt=ü
-MeidaPlayer.Ctrl.VideoSource=ýַ
-MeidaPlayer.Ctrl.Open=
-MeidaPlayer.Ctrl.Close=ֹͣ
-MeidaPlayer.Ctrl.Pause=ͣ
-MeidaPlayer.Ctrl.Play=
-MeidaPlayer.Ctrl.AttachPlayer=Ƶ
-MeidaPlayer.Ctrl.DettachPlayer=ȡ
-MeidaPlayer.Ctrl.PublishVideo=Ƶ
-MeidaPlayer.Ctrl.UnPublishVideo=ȡ
-MeidaPlayer.Ctrl.PublishAudio=Ƶ
-MeidaPlayer.Ctrl.UnPublishAudio=ȡ
-
-
-
MultiChannel.Ctrl.ChannelList=Ƶб
MultiChannel.Ctrl.JoinExChannel=ExƵ
MultiChannel.Ctrl.LeaveExChannel=뿪ExƵ
@@ -261,6 +247,8 @@ mediaPlayer.Ctrl.PublishVideo=
mediaPlayer.Ctrl.UnPublishVideo=ȡ
mediaPlayer.Ctrl.PublishAudio=Ƶ
mediaPlayer.Ctrl.UnPublishAudio=ȡ
+mediaPlayer.Ctrl.PublishStream=
+mediaPlayer.Ctrl.PlayerStream=
CrossChannel.Ctrl.CrossChannel = ԽƵ
CrossChannel.Ctrl.Token =
diff --git a/windows/APIExample/install.ps1 b/windows/APIExample/install.ps1
index d41efaf73..c30260c71 100644
--- a/windows/APIExample/install.ps1
+++ b/windows/APIExample/install.ps1
@@ -1,6 +1,6 @@
$ThirdPartysrc = 'https://download.agora.io/staging/ThirdParty.zip'
$ThirdPartydes = 'ThirdParty.zip'
-$agora_sdk = 'https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_v4.2.3_FULL.zip'
+$agora_sdk = 'https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_v4.2.6_FULL.zip'
$agora_des = 'AgoraSdk.zip'
$agora_local_sdk = '../../sdk'