How can I get a handle on a Video and determine if it has ended

For instance if I wanted to determine if this video had ended and alert “ENDED!” when the video ends, how can I go about doing that?

https://snack.expo.io/rJ1DfWRdZ

You can use onPlaybackStatusUpdate

Documentation: https://docs.expo.io/versions/latest/sdk/video.html#onplaybackstatusupdate
Example: https://docs.expo.io/versions/latest/sdk/av.html#example-2

1 Like

I found the example confusing but have found this stackoverflow question that helped a lot

1 Like