Skip to content
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

Allow customisation of the control widgets #100

Open
cbenhagen opened this issue Jan 16, 2019 · 2 comments
Open

Allow customisation of the control widgets #100

cbenhagen opened this issue Jan 16, 2019 · 2 comments

Comments

@cbenhagen
Copy link
Collaborator

It would be nice if the Chewie user could remove / add / reorder the control widgets. For example users would want to remove the ability to fullscreen or mute. Or they might want to add a button to switch between different versions / encodings of a video.

Instead of adding allowFullScreen, allowMuting: What about a list of widgets for the materialBottomControlBar? And one for cupertinoBottomControlBar plus cupertinoTopLeftControl and cupertinoTopRightControl? The ChewieController (#99) would make it much easier for the user to add own or the original widgets.

@brianegan
Copy link
Collaborator

brianegan commented Jan 16, 2019

I think some customization here makes sense -- it's a common request. My goal for Chewie was for it to be "Plug n Play," so if we go this route I'd still like to have the default factory constructor that sets up Chewie in the easiest possible way for consumers, and perhaps additional constructors for more advanced cases. I could see something like:

Chewie(allowFullScreen: true) remaining the default, while
Chewie.custom(loading: MyWidget(), seekBar: MySeekBarWidget(), moarWidgets: [Go(), Here()])

As you said, if you can access the ChewieController via an InheritedWidget, it should be pretty easy to make all of this work! Inside your custom Widgets, you could just ChewieController.of(context).addListener or ChewieController.of(context).goFullScreen(), whatevs.

@cbenhagen
Copy link
Collaborator Author

Great so I will give this a go as soon as the ChewieController is done. We do not have allowFullScreen yet. But there is a PR for it. Do you want me to rebase this on top of the ChewieController changes? Or do we explain in the readme how to customise the toolbar using a named constructor with an example of how to remove the fullscreen button? Or do we want to have both options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants