Skip to content

Commit 08c8f81

Browse files
authored
Merge pull request #121 from AgoraIO/feature/sequence
Use best API sequence
2 parents 53a1723 + d8001ff commit 08c8f81

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

OpenLive-Android/app/src/main/java/io/agora/openlive/AgoraApplication.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ public class AgoraApplication extends Application {
2121
public void onCreate() {
2222
super.onCreate();
2323
try {
24-
mRtcEngine = RtcEngine.create(getApplicationContext(), getString(R.string.private_app_id), mHandler);
25-
// Sets the channel profile of the Agora RtcEngine.
26-
// The Agora RtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
27-
mRtcEngine.setChannelProfile(io.agora.rtc.Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
28-
mRtcEngine.enableVideo();
24+
mRtcEngine = RtcEngine.create(getApplicationContext(), getString(R.string.private_app_id), mHandler);
2925
mRtcEngine.setLogFile(FileUtil.initializeLogFile(this));
3026
} catch (Exception e) {
3127
e.printStackTrace();

OpenLive-Android/app/src/main/java/io/agora/openlive/activities/LiveActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ private void initUI() {
4444
roomName.setSelected(true);
4545

4646
initUserIcon();
47-
4847
int role = getIntent().getIntExtra(
4948
io.agora.openlive.Constants.KEY_CLIENT_ROLE,
5049
Constants.CLIENT_ROLE_AUDIENCE);

OpenLive-Android/app/src/main/java/io/agora/openlive/activities/RtcBaseActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public abstract class RtcBaseActivity extends BaseActivity implements EventHandl
1616
@Override
1717
protected void onCreate(Bundle savedInstanceState) {
1818
super.onCreate(savedInstanceState);
19-
registerRtcEventHandler(this);
20-
configVideo();
19+
registerRtcEventHandler(this);
2120
joinChannel();
2221
}
2322

@@ -42,6 +41,12 @@ private void joinChannel() {
4241
if (TextUtils.isEmpty(token) || TextUtils.equals(token, "#YOUR ACCESS TOKEN#")) {
4342
token = null; // default, no token
4443
}
44+
45+
// Sets the channel profile of the Agora RtcEngine.
46+
// The Agora RtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
47+
rtcEngine().setChannelProfile(io.agora.rtc.Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
48+
rtcEngine().enableVideo();
49+
configVideo();
4550
rtcEngine().joinChannel(token, config().getChannelName(), "", 0);
4651
}
4752

0 commit comments

Comments
 (0)