Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix android bug for 4.5.0 #427

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ public void onNothingSelected(AdapterView<?> parent) {

mRootBinding.spinnerScenario.setOnItemSelectedListener(this);
mRootBinding.spinnerSnapshot.setOnItemSelectedListener(this);

mRootBinding.btnLocalScreenshot.setEnabled(false);
}

private void resetFps() {
Expand Down Expand Up @@ -388,6 +390,7 @@ public void onPermissionsResult(boolean allPermissionsGranted, String[] permissi
}
});
} else {
mRootBinding.btnLocalScreenshot.setEnabled(false);
joined = false;
mRootBinding.llContainerFp.setVisibility(View.GONE);
isHost = false;
Expand Down Expand Up @@ -638,7 +641,7 @@ private void takeSnapshot(int uid) {
showLongToast(getString(R.string.join_channel_first));
return;
}
String filePath = requireContext().getExternalCacheDir().getAbsolutePath() + "_livestreaming_snapshot.png";
String filePath = new File(requireContext().getExternalCacheDir(), uid + "_livestreaming_snapshot.png").getAbsolutePath();
SnapshotConfig config = new SnapshotConfig();
config.filePath = filePath;
if (uid == myUid) {
Expand All @@ -647,7 +650,7 @@ private void takeSnapshot(int uid) {
if (ret != Constants.ERR_OK) {
showLongToast("takeSnapshot local error code=" + ret + ",msg=" + RtcEngine.getErrorDescription(ret));
}
}else{
} else {
if (uid != 0) {
// config.position = Constants.VideoModulePosition.VIDEO_MODULE_POSITION_PRE_RENDERER;
// int ret = engine.takeSnapshot(uid, config);
Expand Down Expand Up @@ -847,6 +850,11 @@ public void onClientRoleChanged(int oldRole, int newRole, ClientRoleOptions newR
Log.i(TAG, String.format("client role changed from state %d to %d", oldRole, newRole));
runOnUIThread(() -> {
mRootBinding.btnPublish.setEnabled(true);
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
mRootBinding.btnLocalScreenshot.setEnabled(true);
} else {
mRootBinding.btnLocalScreenshot.setEnabled(false);
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object ByteDanceBeautySDK {

private const val TAG = "ByteDanceBeautySDK"

private val LICENSE_NAME = "Agora_test_20240712_20241016_io.agora.entfull_4.5.0_1770.licbag"
private val LICENSE_NAME = "Agora_test_20241014_20241214_io.agora.entfull_4.5.0_2060.licbag"
private var storagePath = ""
private var assetsPath = ""
private var licensePath = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
android:id="@+id/btn_local_screenshot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:layout_marginBottom="4dp"
android:text="@string/local_screenshot" />

Expand Down
Loading