84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
I'm using the Expo-Video-Player package and want to get the elapsed time while the video is playing.
playIcon} replayIcon={() => replayIcon} pauseIcon={() => pauseIcon} sliderColor={"#CE4A52"} />
You can use theonPlaybackStatusUpdateattribute. This is a callback function that receives aPlaybackStatusobject as a parameter.
onPlaybackStatusUpdate
PlaybackStatus
PlaybackStatusobject has apositionMillisproperty that represents the current position of the playhead in milliseconds.
positionMillis
For example:
console.log(status.positionMillis)} />
For more information, seeExpo AV Documentation,Expo AV Usage,positionMillisProperties
To achieve this, call this function in props.
playbackCallBack={(e) => { console.log(e.positionMillis) }
You can then use progressUpdateIntervalMillis: 1000 in the videoProps property to adjust how often (in milliseconds) the event fires.
You can use the
TheonPlaybackStatusUpdate
attribute. This is a callback function that receives aPlaybackStatus
object as a parameter.PlaybackStatus
object has apositionMillis
property that represents the current position of the playhead in milliseconds.For example:
For more information, seeExpo AV Documentation,Expo AV Usage,
positionMillis
PropertiesTo achieve this, call this function in props.
You can then use progressUpdateIntervalMillis: 1000 in the videoProps property to adjust how often (in milliseconds) the event fires.