Wayaer / fl_pip

flutter picture-in-picture plugin for ios and android
MIT License
19 stars 13 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

Open Honelign opened 9 months ago

Honelign commented 9 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 8 months ago

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

Honelign commented 8 months ago

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

@dpatel-jac does the PIP worked for you?

Wayaer commented 6 months ago

Try updating to the latest version