Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PictureInPicture feature for Video Activity #127

Open
james04gr opened this issue Aug 18, 2020 · 8 comments
Open

Enable PictureInPicture feature for Video Activity #127

james04gr opened this issue Aug 18, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@james04gr
Copy link

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.

@Alton09 Alton09 added the enhancement New feature or request label Aug 18, 2020
@Alton09 Alton09 self-assigned this Aug 18, 2020
@Alton09
Copy link
Contributor

Alton09 commented Aug 18, 2020

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.

@himanshu-my
Copy link

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

@james04gr
Copy link
Author

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

@Alton09
Copy link
Contributor

Alton09 commented May 11, 2021

Closing this issue as it will be covered in #212

@Alton09 Alton09 closed this as completed May 11, 2021
@Alton09
Copy link
Contributor

Alton09 commented May 11, 2021

Whoops wrong ticket. Reopening...

@Alton09 Alton09 reopened this May 11, 2021
@shashwat-concent
Copy link

Any update on this feature?

@15652627534
Copy link

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

Can you share the demo of pip?

@MohsinaliEMed
Copy link

MohsinaliEMed commented Oct 11, 2022

@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" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants