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

时间:2019-09-07 11:09:34

标签: android jitsi jitsi-meet

我需要将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);
    }

1 个答案:

答案 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);
}