Page 1 of 1
Video:seek() doesn't appear to work in reverse
Posted: Thu Jul 19, 2018 6:41 am
by NotExplosive
When I use seek() on a video to playback a part of the video I already saw, it doesn't appear to work. What happens is the audio resets to the correct point, but the video playback freezes. Usually it unfreezes once the audio catches back up to where the video moved from.
Anyone else seen this? Is there a workaround?
Re: Video:seek() doesn't appear to work in reverse
Posted: Sun Jul 07, 2024 10:54 pm
by robd
Same issue here! I'm trying to map the mouse position to a number of seconds, to scrub through a video. It works, as long as I keep moving the mouse to the right. If I move the mouse to the left at all, the video stops playing until I move it past the play point again.
Code: Select all
function love.load()
video = love.graphics.newVideo("movie.ogg") -- 30 sec
video:play()
w = love.graphics.getWidth()
end
function love.draw()
love.graphics.draw(video, 0, 0)
end
function map(x, in_min, in_max, out_min, out_max)
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
end
function love.mousemoved( x, y, dx, dy, istouch )
secs = map(x, 0, w, 0, 30)
video:seek(secs)
video:play()
end