jhomlala / betterplayer

Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Apache License 2.0
889 stars 929 forks source link

controller in playlist widget? #1286

Open fabioselau077 opened 5 months ago

fabioselau077 commented 5 months ago

To access the events (https://jhomlala.github.io/betterplayer/#/events) you need to create a controller, but there is no way to create a controller in playlist format, since the BetterPlayerPlaylist widget does not receive a controller. .

However, the event has something called "changedPlaylistItem" which left me confused. How do I capture events when using playlist?

winterdl commented 5 months ago

playlist.currentState?.betterPlayerPlaylistController?.betterPlayerController

jczerniakiev commented 2 months ago

The solution proposed by @winterdl does work, however, the listener never receives changedPlaylistItem. Every other event is received except this one.

waqadArshad commented 1 month ago

Hi, how do I access the playlist here? I mean what is this playlist? @jczerniakiev @winterdl

jczerniakiev commented 1 month ago

@waqadArshad An example: https://stackoverflow.com/a/78413013/22682821

waqadArshad commented 1 month ago

https://stackoverflow.com/a/78413013/22682821

Hi, @jczerniakiev thanks for that. I know it might sound dumb but can I control the player (play/pause etc) using this betterPlayerController that I access using the key? or is it just for listening to events?

jczerniakiev commented 1 month ago

https://stackoverflow.com/a/78413013/22682821

Hi, @jczerniakiev thanks for that. I know it might sound dumb but can I control the player (play/pause etc) using this betterPlayerController that I access using the key? or is it just for listening to events?

Sure you can: https://pub.dev/documentation/better_player/latest/better_player/BetterPlayerController/play.html

waqadArshad commented 1 month ago

Thanks a lot. appreciate it. @jczerniakiev. I'll give it a try.