Open pngwn opened 1 year ago
Is there an update on this? This would greatly help me. I am currently using some timers that keep track of the duration of video played by measuring the time between event triggers from play and pause of the video. After measuring the duration between each play and pause segment, when I add them up, the time doesn't match the time showed in the video seek position; it is off by a few seconds. It might not seem like much but I am using it to track human activities(micro activities) performed in video and a few seconds off means the entire label is wrong. I don't know how to offset this shift. Please help! Thanks.
Hello, I'm also working on an app that requires this feature for audios. I have the same problem as @kavincsekaran. Additionally if the user changed the seek position manually it would be impossible to retrieve it.
@moussaKam I was able to achieve a janky manual version of this by creating a Custom Component based on Video. I modified the code in Player.svelte and added an text input element to the player to enter the desired seek time and added a seek button which can be used to set the value of currentTime. I also added an event so that whenever the currentTime changed, it updated an invisible text element in the player with the currentTime and accessed that element using custom javascript in the python gradio app. I haven't looked into the audio player though. If they're similar you could give it a try. I'd be happy to help.
Is your feature request related to a problem? Please describe.
A user was asking for a way to seek to a specific position of a video. Currently this is pretty difficult and requires some hacky javascript (which would probably break). It would be good if we could provide a cleaner way of doing this, preferably via python.
Describe the solution you'd like
Add a
seek
orcurrentTime
kwarg to theupdate
method ofVideo
(and probablyAudio
too). This would allow users to change the position of the video or audio with a clean python API. We could also expose one or two other properties while we are doing this, if it makes sense.