Wayaer / fl_pip

flutter picture-in-picture plugin for ios and android
MIT License
27 stars 14 forks source link

Unable to call the function FlPiP().enable( ios: const FlPiPiOSConfig( enabledWhenBackground: true, path: 'assets/landscape.mp4', packageName: null), android: const FlPiPAndroidConfig( enabledWhenBackground: true, aspectRatio: Rational.maxLandscape())); #9

Closed Honelign closed 1 month ago

Honelign commented 11 months ago

I put this function on a button added the package and changed the MainActivity.kt to import com.fl.pip.FlPiPActivity

class MainActivity : FlPiPActivity() {}

my button is this ElevatedButton( onPressed: () { debugPrint('bg'); FlPiP().enable( ios: const FlPiPiOSConfig( enabledWhenBackground: true, path: 'assets/landscape.mp4', packageName: null), android: const FlPiPAndroidConfig( enabledWhenBackground: true, aspectRatio: Rational.maxLandscape())); }, child: const Text('Enable PiP\nenabledWhenBackground', textAlign: TextAlign.center)), what am I missing here it is not working

E/flutter ( 4084): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:320:7) E/flutter ( 4084): E/flutter ( 4084): #1 FlPiP.enable (package:fl_pip/fl_pip.dart:93:19) E/flutter ( 4084): E/flutter ( 4084): #2 _VideoArticleDetailsState.initPip (package:news_app/pages/video_article_details.dart:173:23) E/flutter ( 4084): E/flutter ( 4084):

dpatel-jac commented 10 months ago

@Honelign, I face same issues when app goes background for ios

Honelign commented 10 months ago

@Honelign, I face same issues when app goes background for ios

@dpatel-jac does the PIP worked for you?

Wayaer commented 9 months ago

Try updating to the latest version