OpenFlutter / neeko

Flutter video player widget based on video_player
Other
70 stars 21 forks source link

Hide back button on player #9

Open ZMChoo opened 4 years ago

ZMChoo commented 4 years ago

Hi, anyone else knows how to hide the back button on the player?

The way how I use the plugin was like this

NeekoPlayerWidget( onSkipPrevious: () { print("previous"); _videoControllerWrapper.prepareDataSource(DataSource.network( "https://.......video........mp4")); }, onSkipNext: () { print("next"); _videoControllerWrapper.prepareDataSource(DataSource.network( "https://.......video........mp4")); }, videoControllerWrapper: _videoControllerWrapper, ),

ZMChoo commented 4 years ago

I have fixed this by manually change the plugin code, not sure is this the right way.

Firstly I added final bool showBackButton; and const NeekoPlayerOptions( `... `... `this.showBackButton = true, `... `... );`

in _neeko_playeroptions.dart file

After that, add void pushFullScreenWidget() { ` ... ` playerOptions: NeekoPlayerOptions( ` ... `showBackButton: widget.playerOptions.showBackButton, ` ... ` ... }

and change if (widget.playerOptions.useController) `Positioned( ` child: TopBar( ` `... to if (widget.playerOptions.useController && widget.playerOptions.showBackButton) `Positioned( ` child: TopBar( ` `...

in _neeko_playerwidget.dart file

Lastly, plugin usage: NeekoPlayerWidget( `playerOptions: NeekoPlayerOptions(showBackButton: false) `...

JarvanMo commented 4 years ago

This a way to do that. However, how control the visibility of landscape backButton