gpt4 book ai didi

android - 我们可以将 JitsiMeetView 添加到我们的自定义布局中吗?

转载 作者:行者123 更新时间:2023-12-04 01:40:10 24 4
gpt4 key购买 nike

我需要将 JitsiMeetView 添加到视频应用程序的自定义布局中。可能吗?

这里我用了——实现('org.jitsi.react:jitsi-meet-sdk:2.2.2'){ transitive = true }

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

videoView = (RelativeLayout) findViewById(R.id.videoView);

view = new JitsiMeetView(MainActivity.this);
JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
.setRoom("https://meet.jit.si/456")
.setAudioMuted(false)
.setVideoMuted(false)
.setAudioOnly(false)
.setWelcomePageEnabled(false)
.build();
view.join(options);

videoView.addView(view);
}

最佳答案

为了获得完美的结果,将 RelativeLayout 更改为 Framelayout,并在添加 View 时设置固定的宽度或高度。

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

videoView = (FrameLayout) findViewById(R.id.videoView);

view = new JitsiMeetView(MainActivity.this);
JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
.setRoom("https://meet.jit.si/456")
.setAudioMuted(false)
.setVideoMuted(false)
.setAudioOnly(false)
.setWelcomePageEnabled(false)
.build();
view.join(options);

videoView.addView(view, 500, 1000);
}

关于android - 我们可以将 JitsiMeetView 添加到我们的自定义布局中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57833118/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com