I maintain these Flutter plugins.
I wrote some blog posts.
Picture in Picture mode management for Flutter. Available only for Android.
License: MIT License
I maintain these Flutter plugins.
I wrote some blog posts.
I have a video player, i want to continue the video when i minimize the app, but the state is changed when minimize and the videoPlayer()
widget is rebuild and the video is restart, how can i fix it?
PiPSwitcher(
childWhenEnabled: videoPlayer(),
childWhenDisabled: Scaffold(body: Column(
children: [
videoPlayer(),
videoList(),
],
),
);
This library is great, but I have a problem.
When I use floating.enable, every time I switch the app or minimize the app, there will be a picture in picture. Is there any way to turn off the picture in picture function? I only found the enable method, not the disable method.
Actually the code you see here is rendering a map.
This Widget HereMap() and its functional argument _onMapCreated is very computational expensive, when I switches to PiP mode then childWhenEnabled is called and its re-rending the entire widget (A lot of computations). Can we somehow make it static or something? Just wanna avoid the re-rendering part, Pls help!!!
I am running Flutter version 3.7.11 and the newest version of the floating package. Moreover, I use the following code to enter Pip Mode:
@override
void didChangeAppLifecycleState(AppLifecycleState lifecycleState) {
if (_pipIsSupported) { // only true if '!kIsWeb && Platform.isAndroid'
if (lifecycleState == AppLifecycleState.inactive) {
// Only enable PiP if the timer is currently running
if (state.mode != ModeRegister.IDLE) {
_floating.enable();
}
}
}
}
However, I run into issues in the following two situation:
In both of these cases I get the following exception:
E/flutter ( 6443): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Activity must be resumed to enter picture-in-picture, null, java.lang.IllegalStateException: Activity must be resumed to enter picture-in-picture
E/flutter ( 6443): at android.app.Activity.enterPictureInPictureMode(Activity.java:2901)
E/flutter ( 6443): at eu.wroblewscy.marcin.floating.floating.FloatingPlugin.onMethodCall(FloatingPlugin.kt:61)
E/flutter ( 6443): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/flutter ( 6443): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter ( 6443): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter ( 6443): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter ( 6443): at android.os.Handler.handleCallback(Handler.java:942)
E/flutter ( 6443): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter ( 6443): at android.os.Looper.loopOnce(Looper.java:201)
E/flutter ( 6443): at android.os.Looper.loop(Looper.java:288)
E/flutter ( 6443): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/flutter ( 6443): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 6443): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter ( 6443): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter ( 6443): )
E/flutter ( 6443): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter ( 6443): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18)
E/flutter ( 6443): <asynchronous suspension>
E/flutter ( 6443): #2 Floating.enable (package:floating/src/floating.dart:83:39)
E/flutter ( 6443): <asynchronous suspension>
E/flutter ( 6443):
Any chance that this can be fixed?
Just wanted to drop a quick note to say thank you for creating this amazing package.
I was wondering if there's any chance you could add an event listener to the package?
like onPipDisabled
onPipEnabled
I think it would be super helpful.
Thanks again for all your hard work on this, it's greatly appreciated!
Am trying to add button in pip view. But PiP view is not allowing the button interaction.
Hello, I use floating in a specific page. When the page dispose, I execute floating.dispose() too. But
I will find the floating window doesn't closed, it still show on my phone.
Is there any advice?
Thank you very much.
Thanks for the nice plugin.
Just like the aspect ratio, could you please add arguments when enabling PiP, to be passed to the PictureInPictureParams
builder? I'm specifically interested in source rect hint.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.