chewie
chewie copied to clipboard
Fixed pop the wrong page when changing the speed and added support for multiple resolutions
1. Fixed pop the wrong page when changing the speed Issue: https://github.com/fluttercommunity/chewie/issues/618
2. Added support for multiple resolutions Issue: https://github.com/fluttercommunity/chewie/issues/852
Now, to be able to change the video resolution, you need to pass the following parameters to the ChewieController:
allowQualityChanging: true- Map
qualities: {
'240p': '<your link to a 240p video>',
'360p': '<your link to a 360p video>',
'720p': <your link to a 720p video>',
'1080p': '<your link to a 1080p video>',
}
The key can be any string that you want to display in the list of resolutions in the player. The value should be link to the video of this resolution.
Also, in order to be able to change the video resolution, I need to redefine the videoPlayerController inside the ChiewieController. Therefore, the onVideoControllerChange callback has been added, which will allow you to get a new controller when it is replaced.
The quality change has been added for iOS and Android only.
@akmalova Thanks for your contribution.
I do have a major concern with changing the resolution. Since this is driven primarily by VideoPlayerController, shouldn't it be relegated to re-creating the ChewieContoller instead of internally mutating the VideoPlayerController? Just trying to wrap my head regarding this change, because the change that you're proposing represents a fundamental shift in the way ChewieController behaves.
@brianegan and/or @Ahmadre, I would like your thoughts on the above.
Also, for the fix that addresses #618, if you can please split that one up into a separate PR, that would be easier for me to review and eventually approve, assuming any concerns that I may raise are eventually addressed.
Thanks in advance.