Android Jitsi - Picture in picture not working

Hi,

I am trying to integrate JitsiMeet in an Android app and I’m running into a couple of problems.
I need to have access to the listener and the 3 callbacks so I can’t use the JitsiMeetActivity directly (that one works fine obviously, but I can’t set the listener to my own activity that way)

  1. If I subclass JitsiMeetActivity, I get access to the listeners, which is fine, but the picture in picture button stops working (does nothing). Below, JActivity extends JitsiMeetActivity, there is no custom code apart from the 3 callbacks from the listener

Also, if I start it using the method described on git (jitsi git):
JActivity.launch(getContext(), JitsiConfig.getJitsiOptions(user, roomName));
This would launch using the static method from JitsiMeetActivity and it would launch JitsiMeetActivity, not my subclass (again using that method I would lose access to listeners)

I’ve started it manually like this (same as the code in the launch method but making sure my own activity fires). This breaks picture in picture, as said above.
Intent intent = new Intent(getContext(), JActivity.class);
intent.setAction(“org.jitsi.meet.CONFERENCE”);
intent.putExtra(“JitsiMeetConferenceOptions”, JitsiConfig.getJitsiOptions(user, roomName));
startActivityForResult(intent, REQUEST_CODE_JITSI);

  1. I’ve tried creating a separate activity and using the JitsiMeetView instead of the above method, but I’m having trouble first with permissions (not sure what is missing, using the code from git) and second, if the permissions are ok after multiple runs, again picture in picture is not working.

All I need is the default behaviour coupled with access to the listener so I can handle join/terminate.

Thanks a lot for the assistance.

PS: I’m also a bit confused on how to make use of a custom colorscheme.js file that would have to be sent as a bundle while building the options object. Can you suggest any way to handle this?

I’ve solved the picture in picture problem, realised I need special manifest declaration for those activities, so that problem is solved.

I could use some help converting the custom colorscheme.js file to Bundle so I can use it for the options file.

Thank you

Any Solution for the ColorScheme building

I haven’t found a solution for the color bundle, no.

Good afternoon friend, I have a similar problem with PIP in jitsi, you could share the Activity to see how you implemented it and you can also share the manifest file that you comment for permissions, it is that the app runs but by minimizing the application in The Android studio console describes an error notifying that PIP mode could not be started.

You need to add supportsPictureInPicture in the manifest

<activity
            android:excludeFromRecents="true"
            android:name=".ui.jitsi.JViewActivity"
            android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
            android:launchMode="singleTask"
            android:supportsPictureInPicture="true" />

Thanks, it still does not work, by any chance you do not know how to disable “Connection Service integration” @saghul recommends in an issue to disable it in order to solve the problem I have, by any chance do you know how to do that? thanks for your help.
@Cosmin

I have not run into this issue so I am not sure.

You can try some of the suggestions from this thread: