Skip to content

Commit 04fb4f6

Browse files
authored
Merge pull request #427 from AgoraIO/dev/4.5.0_android
fix android bug for 4.5.0
2 parents 94501b1 + e05016b commit 04fb4f6

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ public void onNothingSelected(AdapterView<?> parent) {
245245

246246
mRootBinding.spinnerScenario.setOnItemSelectedListener(this);
247247
mRootBinding.spinnerSnapshot.setOnItemSelectedListener(this);
248+
249+
mRootBinding.btnLocalScreenshot.setEnabled(false);
248250
}
249251

250252
private void resetFps() {
@@ -388,6 +390,7 @@ public void onPermissionsResult(boolean allPermissionsGranted, String[] permissi
388390
}
389391
});
390392
} else {
393+
mRootBinding.btnLocalScreenshot.setEnabled(false);
391394
joined = false;
392395
mRootBinding.llContainerFp.setVisibility(View.GONE);
393396
isHost = false;
@@ -638,7 +641,7 @@ private void takeSnapshot(int uid) {
638641
showLongToast(getString(R.string.join_channel_first));
639642
return;
640643
}
641-
String filePath = requireContext().getExternalCacheDir().getAbsolutePath() + "_livestreaming_snapshot.png";
644+
String filePath = new File(requireContext().getExternalCacheDir(), uid + "_livestreaming_snapshot.png").getAbsolutePath();
642645
SnapshotConfig config = new SnapshotConfig();
643646
config.filePath = filePath;
644647
if (uid == myUid) {
@@ -647,7 +650,7 @@ private void takeSnapshot(int uid) {
647650
if (ret != Constants.ERR_OK) {
648651
showLongToast("takeSnapshot local error code=" + ret + ",msg=" + RtcEngine.getErrorDescription(ret));
649652
}
650-
}else{
653+
} else {
651654
if (uid != 0) {
652655
// config.position = Constants.VideoModulePosition.VIDEO_MODULE_POSITION_PRE_RENDERER;
653656
// int ret = engine.takeSnapshot(uid, config);
@@ -847,6 +850,11 @@ public void onClientRoleChanged(int oldRole, int newRole, ClientRoleOptions newR
847850
Log.i(TAG, String.format("client role changed from state %d to %d", oldRole, newRole));
848851
runOnUIThread(() -> {
849852
mRootBinding.btnPublish.setEnabled(true);
853+
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
854+
mRootBinding.btnLocalScreenshot.setEnabled(true);
855+
} else {
856+
mRootBinding.btnLocalScreenshot.setEnabled(false);
857+
}
850858
});
851859
}
852860

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/beauty/ByteDanceBeautySDK.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object ByteDanceBeautySDK {
1111

1212
private const val TAG = "ByteDanceBeautySDK"
1313

14-
private val LICENSE_NAME = "Agora_test_20240712_20241016_io.agora.entfull_4.5.0_1770.licbag"
14+
private val LICENSE_NAME = "Agora_test_20241014_20241214_io.agora.entfull_4.5.0_2060.licbag"
1515
private var storagePath = ""
1616
private var assetsPath = ""
1717
private var licensePath = ""

Android/APIExample/app/src/main/res/layout/fragment_live_streaming.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
android:id="@+id/btn_local_screenshot"
8080
android:layout_width="wrap_content"
8181
android:layout_height="wrap_content"
82+
android:enabled="false"
8283
android:layout_marginBottom="4dp"
8384
android:text="@string/local_screenshot" />
8485

0 commit comments

Comments
 (0)