pip_mode 0.0.3
pip_mode: ^0.0.3 copied to clipboard
The pip_mode plugin allows developers to send any widget into PiP mode, providing a seamless way to keep content visible while users navigate to other apps.
The pip_mode plugin to send any widget into Picture-in-Picture mode, providing a seamless way to keep content visible while users navigate to other apps.
Features #
- Customizable Content: Encapsulate any widget and display it in PiP mode.
- Video Conversion Support: Automatically converts widgets into a video for PiP.
Getting started #
Android #
- Open
android > app > build.gradle
and setminSDK
to 24 or higher. - Enable PiP support for
MainActivity
inAndroidManifest.xml
.
<activity
android:name=".MainActivity"
...
android:supportsPictureInPicture="true"
...>
iOS #
- Set minimum deployment target to 12.1 or higher.
- Open
ios > Runner > Info.plist
and add below lines inside root<dict>
to addBackground Modes
capability & enableAudio, Airplay, and Picture
.
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>AirPlay</string>
<string>picture-in-picture</string>
</array>
- For iOS, test on real device
Usage #
final _controller = PipController();
GestureDetector(
onTap: _controller.startPipMode,
child: PipWidget(
controller: _controller,
onInitialized: (success) => log('Pip Widget Initialized: $success'),
child: Container(
width: 200,
height: 200,
color: Colors.red,
alignment: Alignment.center,
child: Text('Hello World!'),
),
),
),
Additional information #
Think you've found a bug, or would like to see a new feature? We'd love to hear about it! Visit the Issues section of the git repository.