-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChewieController #99
ChewieController #99
Conversation
@brianegan I know it still has some rough edges but if you have time it would be awesome if you could have a quick look at the changes and tell me if this is the direction you'd like this to go. |
Other than a couple small nitpicks, this is exactly the direction I was thinking of going. Really well done :D :D :D |
Two more things: As part of this PR, could you please add yourself to the list of authors in the |
Done :) |
Cool, just added that email as an uploader as well. You should get a confirmation email to that address! Only thing I'd ask: Please update the CHANGELOG as well when ya push new versions to let folks know what's changed. Other than that, not too much to publishing new versions! Thanks again for all the contributions :) Seems like more and more folks are using this library, great to make it better. |
Sure! I will also not push bigger changes without discussing them first. And then we should always guide the users how to migrate. Thank you for that great package! |
We can switch back to using ValueNotifier when we have a lot more values and it is more convenient to change and notify with one `value.copyWith(foo='bar')` instead of explicitly having to call notifyListeners(). Until then the code is just much cleaner without so much boiler plate.
a8a19f2
to
bc12686
Compare
@brianegan, you once mentioned to "add data to be rendered on all the Widgets, probably as |
More finegraned customisation of exisiting controls to be added later.
Nope, this covers it -- the idea was to give something folks can listen to for data updates -- in this case, the Awesome work! I'll do a final review :) |
@brianegan I got more plans for Chewie like supporting multiple versions of a clip as well as playlists. I guess they can both be added without breaking the API again by adding named constructors and internally switching to always having a list(of lists) of VideoControllers but setting one as the current |
bb0285a
to
b41d83d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small details and a bug report! Looking great overall:)
Bug Report:
- Run Example, Tap "Full Screen" Button, Tap android back button, tap "Full Screen" Button again -- broken state. We probably aren't handling the Android Back Button properly here, which can return a "null" value and might be throwing an error if that isn't checked.
lib/src/material_controls.dart
Outdated
chewieController = ChewieControllerProvider.of(context); | ||
controller = chewieController.videoPlayerController; | ||
|
||
_dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike initState
, didChangeDependencies
can run multiple times throughout the lifecycle of the Widget. Therefore, we may want to add some logic around this _dispose
/ initialize
code: Only run that dispose and init IF the controller
has changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it was also reinitializing when the theme changed. fc1bc16 fixes that.
75804f9
to
bf58a0d
Compare
And make the provider private
6030ab9
to
2bd06b7
Compare
Nice catch! Fixed in cd20458. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo! Again, fantastic work 🎉 😄 👏
This Looks Good To Me. Feel free to merge and ship when you think it's ready!
Just noticed that I need a gmail account to upload. Please add my personal mail as uploader: c.ben.hagen@gmail.com |
Oh dang -- just added that email address!
…On Thu, Jan 24, 2019 at 10:02 AM Ben Hagen ***@***.***> wrote:
Just noticed that I need a gmail account to upload. Please add my personal
mail as uploader: ***@***.***
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHujM1bgit4_3RdgqNd-YWg8gszyhbWks5vGXawgaJpZM4aCuU6>
.
|
This is an attempt in fixing #1 by implementing a
ChewieController
which is internally accessed by anInheritedWidget
.TODO:
VideoPlayer
tries to access disposedVideoController
after we changed and disposed it in theChewieController
Listenables
, such asChangeNotifier
orValueNotifier
.Chewie
< 1.0.0fixes #1
fixes #23
fixes #49