Skip to content

Commit

Permalink
update sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxiaozhong committed Aug 19, 2020
1 parent 0335ae0 commit fa169be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 5 additions & 3 deletions AR-Android-Tutorial-1to1/sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ android {
applicationId "org.ar.ar_android_tutorial_1to1"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"


}

buildTypes {
Expand All @@ -34,5 +36,5 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':logger')
implementation 'org.ar:rtc:4.0.0.8'
implementation 'org.ar:rtc:4.0.1.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.KeyEvent;
import android.view.TextureView;
Expand Down Expand Up @@ -83,6 +84,8 @@ private void initEngineAndJoinChannel() {
private void initializeEngine() {
try {
mRtcEngine = RtcEngine.create(getBaseContext(), getResources().getString(R.string.app_id), mRtcEventHandler);
//启用视频模块
mRtcEngine.enableVideo();
} catch (Exception e) {
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
Expand All @@ -94,7 +97,7 @@ private void joinChannel() {
}

private void leaveChannel() {
RtcEngine.destroy();
mRtcEngine.leaveChannel();
}


Expand Down Expand Up @@ -161,8 +164,7 @@ public void run() {
};

private void setupLocalVideo() {
//启用视频模块
mRtcEngine.enableVideo();

//创建TextureView对象
TextureView mLocalView = RtcEngine.CreateRendererView(getBaseContext());
if (rlLocal!=null){
Expand Down Expand Up @@ -199,7 +201,7 @@ private void removeLocalVideo() {
}
}
private void startCall() {
initializeEngine();
// initializeEngine();
setupLocalVideo();
joinChannel();
}
Expand Down Expand Up @@ -287,8 +289,18 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode==KeyEvent.KEYCODE_BACK){
if (!mCallEnd){
endCall();
finish();
return true;
}

}
return super.onKeyDown(keyCode, event);
}


@Override
protected void onDestroy() {
super.onDestroy();
RtcEngine.destroy();
}
}

0 comments on commit fa169be

Please sign in to comment.