我需要将JitsiMeetView添加到视频应用程序的自定义布局中。有可能吗?
我在这里使用- 实施('org.jitsi.react:jitsi-meet-sdk:2.2.2'){传递=真
@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);
}
答案 0 :(得分:4)
为获得完美结果,请将RelativeLayout更改为Framelayout并在添加视图时放置固定的宽度或高度。
@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);
}