Skip to content

Commit

Permalink
添加录制系统音频示例代码
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Jan 3, 2025
1 parent ac50a88 commit 3b87221
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import cn.wildfire.chat.kit.conversation.ext.core.ConversationExt;
import cn.wildfirechat.avenginekit.AVEngineKit;
import cn.wildfirechat.model.Conversation;
import cn.wildfirechat.model.UserInfo;
import cn.wildfirechat.remote.ChatManager;

public class VoipExt extends ConversationExt {
// private String targetId;

@ExtContextMenuItem(tag = ConversationExtMenuTags.TAG_VOIP_VIDEO)
public void video(View containerView, Conversation conversation) {
Expand Down Expand Up @@ -89,8 +88,20 @@ public void audio(View containerView, Conversation conversation) {

private void audioChat(String targetId) {
WfcUIKit.singleCall(activity, targetId, true);
// 下面是开始录制系统音频的示例代码
// this.targetId = targetId;
// MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) fragment.getActivity().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
// startActivityForResult(mediaProjectionManager.createScreenCaptureIntent(), 102);
}

// protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// WfcUIKit.singleCall(activity, targetId, true);
// Intent intent = new Intent(fragment.getContext(), VoipCallService.class);
// intent.putExtra("screenShareForSystemAudioRecord", true);
// intent.putExtra("data", data);
// VoipCallService.start(fragment.getContext(), intent);
// }

private void videoChat(String targetId) {
WfcUIKit.singleCall(activity, targetId, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ public int onStartCommand(Intent intent, int flags, int startId) {
return START_NOT_STICKY;
}

// 录制系统音频示例代码
// boolean screenShareForRecord = intent.getBooleanExtra("screenShareForSystemAudioRecord", false);
// if (screenShareForRecord) {
// Intent data = intent.getParcelableExtra("data");
// session.startRecordSystemAudio(data);
// return START_NOT_STICKY;
// }

focusTargetId = intent.getStringExtra("focusTargetId");
Log.e("wfc", "on startCommand " + focusTargetId);
checkCallState();
Expand Down

0 comments on commit 3b87221

Please sign in to comment.