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
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):