'Why is my onLoad event for a RN video component not firing?
I'm trying to display an Alert message when the video is done loading, but this event doesn't seem to be firing; I've seen that other people have had similar issues, but I haven't been able to find a solution yet.
<Video
onLoad={() => Alert.alert("LOADING")}
ref={video}
style={styles.video}
source={{
uri: "www.myvideo.com",
}}
repeat
/>
Solution 1:[1]
onLoadedData event does the trick:
<Video
onLoadedData={() => Alert.alert("LOADING")}
ref={video}
style={styles.video}
source={{
uri: "www.myvideo.com",
}}
repeat
/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | David |