Skip to content

Commit cfa5eeb

Browse files
authored
Merge pull request #117 from AgoraIO/dev/3.3.0
Dev/3.3.0
2 parents c760efc + 29058e6 commit cfa5eeb

151 files changed

Lines changed: 5755 additions & 1070 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
364 KB
Binary file not shown.

Android/APIExample/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<application
1212
android:name=".MainApplication"
1313
android:allowBackup="true"
14-
android:icon="@mipmap/ic_launcher"
14+
android:icon="@drawable/icon1024"
1515
android:label="@string/app_name"
16-
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:roundIcon="@drawable/icon1024"
1717
android:supportsRtl="true"
1818
android:theme="@style/AppTheme">
1919

Android/APIExample/app/src/main/java/io/agora/api/example/ExampleActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
import io.agora.api.example.examples.advanced.MediaPlayerKit;
2525
import io.agora.api.example.examples.advanced.PlayAudioFiles;
2626
import io.agora.api.example.examples.advanced.PreCallTest;
27+
import io.agora.api.example.examples.advanced.ProcessAudioRawData;
2728
import io.agora.api.example.examples.advanced.ProcessRawData;
2829
import io.agora.api.example.examples.advanced.PushExternalVideo;
30+
import io.agora.api.example.examples.advanced.SendDataStream;
2931
import io.agora.api.example.examples.advanced.SetVideoProfile;
3032
import io.agora.api.example.examples.advanced.SuperResolution;
3133
import io.agora.api.example.examples.advanced.SwitchExternalVideo;
@@ -158,6 +160,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
158160
case R.id.action_mainFragment_arcore:
159161
fragment = new ARCore();
160162
break;
163+
case R.id.action_mainFragment_senddatastream:
164+
fragment = new SendDataStream();
165+
break;
166+
case R.id.action_mainFragment_raw_audio:
167+
fragment = new ProcessAudioRawData();
168+
break;
161169
default:
162170
fragment = new JoinChannelAudio();
163171
break;

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ARCore.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import io.agora.rtc.IRtcEngineEventHandler;
7373
import io.agora.rtc.RtcEngine;
7474
import io.agora.rtc.mediaio.MediaIO;
75+
import io.agora.rtc.models.ChannelMediaOptions;
7576
import io.agora.rtc.video.VideoCanvas;
7677
import io.agora.rtc.video.VideoEncoderConfiguration;
7778

@@ -331,7 +332,11 @@ private void joinChannel(String channelId)
331332
}
332333
/** Allows a user to join a channel.
333334
if you do not specify the uid, we will generate the uid for you*/
334-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
335+
336+
ChannelMediaOptions option = new ChannelMediaOptions();
337+
option.autoSubscribeAudio = true;
338+
option.autoSubscribeVideo = true;
339+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
335340
if (res != 0)
336341
{
337342
// Usually happens with invalid parameters
@@ -370,6 +375,15 @@ public void onError(int err)
370375
{
371376
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
372377
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
378+
/** Upload current log file immediately to server.
379+
* only use this when an error occurs
380+
* block before log file upload success or timeout.
381+
*
382+
* @return
383+
* - 0: Success.
384+
* - < 0: Failure.
385+
*/
386+
engine.uploadLogFile();
373387
}
374388

375389
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/AdjustVolume.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.agora.rtc.Constants;
2626
import io.agora.rtc.IRtcEngineEventHandler;
2727
import io.agora.rtc.RtcEngine;
28+
import io.agora.rtc.models.ChannelMediaOptions;
2829

2930
import static io.agora.api.example.common.model.Examples.ADVANCED;
3031
import static io.agora.api.example.common.model.Examples.BASIC;
@@ -237,7 +238,11 @@ private void joinChannel(String channelId) {
237238
/** Allows a user to join a channel.
238239
if you do not specify the uid, we will generate the uid for you*/
239240
engine.enableAudioVolumeIndication(1000, 3, true);
240-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
241+
242+
ChannelMediaOptions option = new ChannelMediaOptions();
243+
option.autoSubscribeAudio = true;
244+
option.autoSubscribeVideo = true;
245+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
241246
if (res != 0) {
242247
// Usually happens with invalid parameters
243248
// Error code description can be found at:
@@ -271,6 +276,15 @@ public void onWarning(int warn) {
271276
public void onError(int err) {
272277
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
273278
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
279+
/** Upload current log file immediately to server.
280+
* only use this when an error occurs
281+
* block before log file upload success or timeout.
282+
*
283+
* @return
284+
* - 0: Success.
285+
* - < 0: Failure.
286+
*/
287+
engine.uploadLogFile();
274288
}
275289

276290
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/ChannelEncryption.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import io.agora.rtc.IRtcEngineEventHandler;
2929
import io.agora.rtc.RtcEngine;
3030
import io.agora.rtc.internal.EncryptionConfig;
31+
import io.agora.rtc.models.ChannelMediaOptions;
3132
import io.agora.rtc.video.VideoCanvas;
3233
import io.agora.rtc.video.VideoEncoderConfiguration;
3334

@@ -235,7 +236,11 @@ private void joinChannel(String channelId)
235236
}
236237
/** Allows a user to join a channel.
237238
if you do not specify the uid, we will generate the uid for you*/
238-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
239+
240+
ChannelMediaOptions option = new ChannelMediaOptions();
241+
option.autoSubscribeAudio = true;
242+
option.autoSubscribeVideo = true;
243+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
239244
if (res != 0)
240245
{
241246
// Usually happens with invalid parameters
@@ -270,6 +275,15 @@ public void onError(int err)
270275
{
271276
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
272277
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
278+
/** Upload current log file immediately to server.
279+
* only use this when an error occurs
280+
* block before log file upload success or timeout.
281+
*
282+
* @return
283+
* - 0: Success.
284+
* - < 0: Failure.
285+
*/
286+
engine.uploadLogFile();
273287
}
274288

275289
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import io.agora.rtc.RtcEngine;
2929
import io.agora.rtc.mediaio.AgoraSurfaceView;
3030
import io.agora.rtc.mediaio.MediaIO;
31+
import io.agora.rtc.models.ChannelMediaOptions;
3132
import io.agora.rtc.video.VideoCanvas;
3233
import io.agora.rtc.video.VideoEncoderConfiguration;
3334

@@ -206,7 +207,11 @@ private void joinChannel(String channelId) {
206207
}
207208
/** Allows a user to join a channel.
208209
if you do not specify the uid, we will generate the uid for you*/
209-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
210+
211+
ChannelMediaOptions option = new ChannelMediaOptions();
212+
option.autoSubscribeAudio = true;
213+
option.autoSubscribeVideo = true;
214+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
210215
if (res != 0) {
211216
// Usually happens with invalid parameters
212217
// Error code description can be found at:
@@ -237,6 +242,15 @@ public void onWarning(int warn) {
237242
public void onError(int err) {
238243
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
239244
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
245+
/** Upload current log file immediately to server.
246+
* only use this when an error occurs
247+
* block before log file upload success or timeout.
248+
*
249+
* @return
250+
* - 0: Success.
251+
* - < 0: Failure.
252+
*/
253+
engine.uploadLogFile();
240254
}
241255

242256
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/GeoFencing.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import com.yanzhenjie.permission.AndPermission;
2020
import com.yanzhenjie.permission.runtime.Permission;
2121

22+
import java.text.SimpleDateFormat;
23+
import java.util.Date;
24+
2225
import io.agora.api.example.MainApplication;
2326
import io.agora.api.example.R;
2427
import io.agora.api.example.annotation.Example;
@@ -28,6 +31,7 @@
2831
import io.agora.rtc.IRtcEngineEventHandler;
2932
import io.agora.rtc.RtcEngine;
3033
import io.agora.rtc.RtcEngineConfig;
34+
import io.agora.rtc.models.ChannelMediaOptions;
3135
import io.agora.rtc.video.VideoCanvas;
3236
import io.agora.rtc.video.VideoEncoderConfiguration;
3337

@@ -113,6 +117,12 @@ private void initializeEngine() {
113117
config.mEventHandler = iRtcEngineEventHandler;
114118
config.mContext = context.getApplicationContext();
115119
config.mAreaCode = getAreaCode();
120+
RtcEngineConfig.LogConfig logConfig = new RtcEngineConfig.LogConfig();
121+
// Log level set to ERROR
122+
logConfig.level = Constants.LogLevel.getValue(Constants.LogLevel.LOG_LEVEL_ERROR);
123+
// Log file size to 2MB
124+
logConfig.fileSize = 2048;
125+
config.mLogConfig = logConfig;
116126
engine = RtcEngine.create(config);
117127
} catch (Exception e) {
118128
e.printStackTrace();
@@ -229,7 +239,11 @@ private void joinChannel(String channelId) {
229239
}
230240
/** Allows a user to join a channel.
231241
if you do not specify the uid, we will generate the uid for you*/
232-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
242+
243+
ChannelMediaOptions option = new ChannelMediaOptions();
244+
option.autoSubscribeAudio = true;
245+
option.autoSubscribeVideo = true;
246+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0,option);
233247
if (res != 0) {
234248
// Usually happens with invalid parameters
235249
// Error code description can be found at:
@@ -264,6 +278,15 @@ public void onError(int err) {
264278
handler.post(() -> join.setEnabled(true));
265279
} else
266280
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
281+
/** Upload current log file immediately to server.
282+
* only use this when an error occurs
283+
* block before log file upload success or timeout.
284+
*
285+
* @return
286+
* - 0: Success.
287+
* - < 0: Failure.
288+
*/
289+
engine.uploadLogFile();
267290
}
268291

269292
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/HostAcrossChannel.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import io.agora.rtc.Constants;
2727
import io.agora.rtc.IRtcEngineEventHandler;
2828
import io.agora.rtc.RtcEngine;
29+
import io.agora.rtc.models.ChannelMediaOptions;
2930
import io.agora.rtc.video.ChannelMediaInfo;
3031
import io.agora.rtc.video.ChannelMediaRelayConfiguration;
3132
import io.agora.rtc.video.VideoCanvas;
@@ -257,7 +258,11 @@ private void joinChannel(String channelId)
257258
}
258259
/** Allows a user to join a channel.
259260
if you do not specify the uid, we will generate the uid for you*/
260-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
261+
262+
ChannelMediaOptions option = new ChannelMediaOptions();
263+
option.autoSubscribeAudio = true;
264+
option.autoSubscribeVideo = true;
265+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
261266
if (res != 0)
262267
{
263268
// Usually happens with invalid parameters
@@ -292,6 +297,15 @@ public void onError(int err)
292297
{
293298
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
294299
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
300+
/** Upload current log file immediately to server.
301+
* only use this when an error occurs
302+
* block before log file upload success or timeout.
303+
*
304+
* @return
305+
* - 0: Success.
306+
* - < 0: Failure.
307+
*/
308+
engine.uploadLogFile();
295309
}
296310

297311
/**Occurs when a user leaves the channel.

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/InCallReport.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import io.agora.rtc.Constants;
2929
import io.agora.rtc.IRtcEngineEventHandler;
3030
import io.agora.rtc.RtcEngine;
31+
import io.agora.rtc.models.ChannelMediaOptions;
3132
import io.agora.rtc.video.VideoCanvas;
3233
import io.agora.rtc.video.VideoEncoderConfiguration;
3334

@@ -235,7 +236,11 @@ private void joinChannel(String channelId)
235236
}
236237
/** Allows a user to join a channel.
237238
if you do not specify the uid, we will generate the uid for you*/
238-
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0);
239+
240+
ChannelMediaOptions option = new ChannelMediaOptions();
241+
option.autoSubscribeAudio = true;
242+
option.autoSubscribeVideo = true;
243+
int res = engine.joinChannel(accessToken, channelId, "Extra Optional Data", 0, option);
239244
if (res != 0)
240245
{
241246
// Usually happens with invalid parameters
@@ -270,6 +275,15 @@ public void onError(int err)
270275
{
271276
Log.e(TAG, String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
272277
showAlert(String.format("onError code %d message %s", err, RtcEngine.getErrorDescription(err)));
278+
/** Upload current log file immediately to server.
279+
* only use this when an error occurs
280+
* block before log file upload success or timeout.
281+
*
282+
* @return
283+
* - 0: Success.
284+
* - < 0: Failure.
285+
*/
286+
engine.uploadLogFile();
273287
}
274288

275289
/**Occurs when a user leaves the channel.

0 commit comments

Comments
 (0)