3

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

这里我使用了 - implementation ('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);
    }
4

1 回答 1

4

为了获得完美的效果,请将 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);
}
于 2020-06-11T11:19:08.103 回答