Skip to content

Commit

Permalink
Merge pull request #117 from AgoraIO/dev/3.3.0
Browse files Browse the repository at this point in the history
Dev/3.3.0
  • Loading branch information
plutoless authored Jan 30, 2021
2 parents 4e1af5c + 204d9e1 commit 34a0897
Show file tree
Hide file tree
Showing 151 changed files with 5,755 additions and 1,070 deletions.
Binary file modified Android/APIExample/app/libs/RtcChannelPublishHelper.aar
Binary file not shown.
4 changes: 2 additions & 2 deletions Android/APIExample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<application
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/icon1024"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/icon1024"
android:supportsRtl="true"
android:theme="@style/AppTheme">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import io.agora.api.example.examples.advanced.MediaPlayerKit;
import io.agora.api.example.examples.advanced.PlayAudioFiles;
import io.agora.api.example.examples.advanced.PreCallTest;
import io.agora.api.example.examples.advanced.ProcessAudioRawData;
import io.agora.api.example.examples.advanced.ProcessRawData;
import io.agora.api.example.examples.advanced.PushExternalVideo;
import io.agora.api.example.examples.advanced.SendDataStream;
import io.agora.api.example.examples.advanced.SetVideoProfile;
import io.agora.api.example.examples.advanced.SuperResolution;
import io.agora.api.example.examples.advanced.SwitchExternalVideo;
Expand Down Expand Up @@ -158,6 +160,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
case R.id.action_mainFragment_arcore:
fragment = new ARCore();
break;
case R.id.action_mainFragment_senddatastream:
fragment = new SendDataStream();
break;
case R.id.action_mainFragment_raw_audio:
fragment = new ProcessAudioRawData();
break;
default:
fragment = new JoinChannelAudio();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.mediaio.MediaIO;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

Expand Down Expand Up @@ -331,7 +332,11 @@ private void joinChannel(String channelId)
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
if (res != 0)
{
// Usually happens with invalid parameters
Expand Down Expand Up @@ -370,6 +375,15 @@ public void onError(int err)
{
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.models.ChannelMediaOptions;

import static io.agora.api.example.common.model.Examples.ADVANCED;
import static io.agora.api.example.common.model.Examples.BASIC;
Expand Down Expand Up @@ -237,7 +238,11 @@ private void joinChannel(String channelId) {
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
engine.enableAudioVolumeIndication(1000, 3, true);
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
if (res != 0) {
// Usually happens with invalid parameters
// Error code description can be found at:
Expand Down Expand Up @@ -271,6 +276,15 @@ public void onWarning(int warn) {
public void onError(int err) {
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.internal.EncryptionConfig;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

Expand Down Expand Up @@ -235,7 +236,11 @@ private void joinChannel(String channelId)
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
if (res != 0)
{
// Usually happens with invalid parameters
Expand Down Expand Up @@ -270,6 +275,15 @@ public void onError(int err)
{
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.agora.rtc.RtcEngine;
import io.agora.rtc.mediaio.AgoraSurfaceView;
import io.agora.rtc.mediaio.MediaIO;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

Expand Down Expand Up @@ -206,7 +207,11 @@ private void joinChannel(String channelId) {
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
if (res != 0) {
// Usually happens with invalid parameters
// Error code description can be found at:
Expand Down Expand Up @@ -237,6 +242,15 @@ public void onWarning(int warn) {
public void onError(int err) {
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.runtime.Permission;

import java.text.SimpleDateFormat;
import java.util.Date;

import io.agora.api.example.MainApplication;
import io.agora.api.example.R;
import io.agora.api.example.annotation.Example;
Expand All @@ -28,6 +31,7 @@
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.RtcEngineConfig;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

Expand Down Expand Up @@ -113,6 +117,12 @@ private void initializeEngine() {
config.mEventHandler = iRtcEngineEventHandler;
config.mContext = context.getApplicationContext();
config.mAreaCode = getAreaCode();
RtcEngineConfig.LogConfig logConfig = new RtcEngineConfig.LogConfig();
// Log level set to ERROR
logConfig.level = Constants.LogLevel.getValue(Constants.LogLevel.LOG_LEVEL_ERROR);
// Log file size to 2MB
logConfig.fileSize = 2048;
config.mLogConfig = logConfig;
engine = RtcEngine.create(config);
} catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -229,7 +239,11 @@ private void joinChannel(String channelId) {
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
if (res != 0) {
// Usually happens with invalid parameters
// Error code description can be found at:
Expand Down Expand Up @@ -264,6 +278,15 @@ public void onError(int err) {
handler.post(() -> join.setEnabled(true));
} else
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.ChannelMediaInfo;
import io.agora.rtc.video.ChannelMediaRelayConfiguration;
import io.agora.rtc.video.VideoCanvas;
Expand Down Expand Up @@ -257,7 +258,11 @@ private void joinChannel(String channelId)
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
if (res != 0)
{
// Usually happens with invalid parameters
Expand Down Expand Up @@ -292,6 +297,15 @@ public void onError(int err)
{
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

Expand Down Expand Up @@ -235,7 +236,11 @@ private void joinChannel(String channelId)
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
if (res != 0)
{
// Usually happens with invalid parameters
Expand Down Expand Up @@ -270,6 +275,15 @@ public void onError(int err)
{
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ private void joinChannel(String channelId)
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
if (res != 0 || !joinSecondChannel())
{
// Usually happens with invalid parameters
Expand Down Expand Up @@ -339,6 +343,15 @@ public void onWarning(int warn) {
public void onError(int err) {
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.models.ChannelMediaOptions;
import io.agora.rtc.models.ClientRoleOptions;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;
Expand Down Expand Up @@ -263,7 +264,11 @@ private void joinChannel(String channelId) {
}
/** Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);

ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;
option.autoSubscribeVideo = true;
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
if (res != 0) {
// Usually happens with invalid parameters
// Error code description can be found at:
Expand Down Expand Up @@ -294,6 +299,15 @@ public void onWarning(int warn) {
public void onError(int err) {
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
/** Upload current log file immediately to server.
* only use this when an error occurs
* block before log file upload success or timeout.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
engine.uploadLogFile();
}

/**Occurs when a user leaves the channel.
Expand Down
Loading

0 comments on commit 34a0897

Please sign in to comment.