chewie
chewie copied to clipboard
Question: Update Overlay when video position != 0
Hi,
thank you for your work on chewie.
I have separate image posters/thumbnails for my videos and would like to show them only when the video position is at zero.
I've setup an overlay widget and a listener on the videoplayer controller; when the videoplayer.value.position !=0 then I want to remove the overlay; however the overlay is final so I don't think I can update.
Is there an alternative approach to this? I could show the poster/thumbnail in a Stack Widget but I think updating the overlay would be a better option.
Thanks!
@gbminnock have you tried returning Container when the position doesn't equal zero?
In other words, if the builder gets called every time the position changes, then you should be able to send back an empty Container when it's greater than zero.
In other words, if the builder gets called every time the position changes, then you should be able to send back an empty
Containerwhen it's greater than zero.
@diegotori You mean to set the _chewieController.overlay = Container() ? I'm not sure I follow...
Sorry, I misspoke. ChewieController has a copyWith method that should allow you to update the Overlay Widget when that event occurs, then merely call setState() to rebuild the Widget.