twilio-video-app-android icon indicating copy to clipboard operation
twilio-video-app-android copied to clipboard

Enable PictureInPicture feature for Video Activity

Open james04gr opened this issue 4 years ago • 8 comments

Since Android 8.0 (API 26) allows activities to launch in PictureInPicture mode it would be very useful and helpful that you integrate this in the twilio-video-app example that you have.

james04gr avatar Aug 18 '20 11:08 james04gr

Hi @james04gr . Thanks for reaching out regarding this enhancement! This would definitely be a great feature to add to the app. We'll add this to our backlog as an enhancement. Also, feel free to open a pull request if you'd like to see this integrated into the app sooner.

Alton09 avatar Aug 18 '20 15:08 Alton09

Hi, I have achieved PIP mode in my video calling app. I will try to generate PR for it.

himanshu-my avatar Feb 17 '21 06:02 himanshu-my

Hi, I have achieved PIP mode in my video calling app. I will try to generate PR for it.

Hello. I would really appreciate if you could do so, since i want to integrate it in my webrtc app also! Thank you

james04gr avatar Feb 17 '21 10:02 james04gr

Closing this issue as it will be covered in #212

Alton09 avatar May 11 '21 15:05 Alton09

Whoops wrong ticket. Reopening...

Alton09 avatar May 11 '21 15:05 Alton09

Any update on this feature?

shashwat-concent avatar Dec 30 '21 02:12 shashwat-concent

嗨,我已经在我的视频通话应用程序中实现了 PIP 模式。我会尝试为它生成 PR。

Can you share the demo of pip?

15652627534 avatar Apr 21 '22 10:04 15652627534

@15652627534

    // add in video activity
    private boolean startPictureInPicture() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            enterPictureInPictureMode(
                    new PictureInPictureParams.Builder()
                            .setAspectRatio(getPipRatio()) //new Rational(2, 4) // This has lower and upper
                            .build()
            );
            return true;
        }
        return false;
    }


//override method for check is in pip mode or not
@SuppressLint("MissingSuperCall")
    @Override
    public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig) {
        if (isInPictureInPictureMode) {
            
        } else {

        }
     
    }

//add in manifest 
<activity
            android:name=".VideoActivity"
            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
            android:excludeFromRecents="true"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:supportsPictureInPicture="true" />

MohsinaliEMed avatar Oct 11 '22 12:10 MohsinaliEMed