Open ChristopherGabba opened 7 months ago
Sound like good idea! I will add this to roadmap 👍
I'd love if we could get that before the 7.0, deprecate old events and remove them in v7.
onPlaybackStateChanged
is triggered when the player buffers BEFORE onBuffer
is called. To prevent pausing (and updating controls) when the player buffers, the only solution is to use a setTimeout() and check if the player has buffered.
Description
Currently there are several events that do specific things:
onBuffer
: tracks whether or not the player is bufferingonPlaybackStateChanged
: tracks whether or not the player is playingonEnd
: tracks whether or not the video is endedonIdle
: currently missing from the documentation, but guess it's when the player idlesReally all of these methods could be wrapped up into a single method like the
react-native-youtube-iframe
onChangeState:Why it is needed ?
Would really simplify my code. Instead I have to have 4 different methods to handle this scenario. Would be great to have one single method that tracks the current status of the player.
Possible implementation
Not sure :(
Code sample