Open globalhuman opened 1 month ago
Hi, I don't see that option in the apple AVPlayer: https://developer.apple.com/documentation/avfoundation/avplayer There's an option to enable PiP, but not one to start the player automatically in PiP, unless I missed something.
I experimented with a few booleans again, but I couldn't make it run PiP automatically. I think Apple doesn't want PiP to be automatic, it has to require user interaction (clicking on the PiP icon).
There's a neat feature that I haven't advertised, though: if you start playing a video, and you haven't clicked to start PictureInPicture, then a-Shell will continue the sound track (because that's feasible) while removing the video track.
I'm not an iOS developer so can only do some basic research on if it's possible. Thanks for experimenting further yourself.
Would the following methods indicate that it could be possible?
https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/startpictureinpicture()
After reading a little further I realise that the canStartPictureInPictureAutomaticallyFromInline()
method indicates that PiP can start automatically when putting the app to the background. I experimented with adding a short wait X seconds
then Go to home screen
and the video continue playing in the background. So at least as a workaround that seems to help out for now.
Happy for you to close this if your own research finds that it's not possible and that the workaround is sufficient for your users
I have created some iOS shortcuts to imitate PiP from the stock photos app/gallery app which executes a-shell mini scripts to play a video using the following command:
play movie.mp4
It would be great if there was an option to enable PiP directly from the command such that it opens the video directly in PiP mode i.e.
play movie.mp4 --pip
Is this possible, or are there other methods which would be possible for me to try?