How to get the elapsed time of expo video
P粉738676186
P粉738676186 2023-09-12 18:22:23
0
2
461

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"} />

P粉738676186
P粉738676186

reply all (2)
P粉046387133

You can use theonPlaybackStatusUpdateattribute. This is a callback function that receives aPlaybackStatusobject as a parameter.

The

PlaybackStatusobject has apositionMillisproperty that represents the current position of the playhead in milliseconds.

For example:

For more information, seeExpo AV Documentation,Expo AV Usage,positionMillisProperties

    P粉956441054

    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.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!