local video
function love.load()
video = love.graphics.newVideo("video.ogv")
video:play()
end
function love.update()
print(video:isPlaying())
end
function love.draw()
love.graphics.draw(video, 0, 0)
end
portify wrote:Is there any way to get the duration of a video?
Kind of a hack but you should be able to get it from the audio Source with Source:getDuration() (you can get the source with video: get source()). This might of course not work if the video doesn't have an audio track and is a bit weird in general.
It turns out Ogg Theora is particularly awkward because it doesn't have any kind of length info or index. The love.video code could definitely use some cleanup, and apparently bugfixes, and could definitely use some more features. Consider it something for 0.10.1. Feature request welcome, though.
I can confirm that I have the same problem! I need to make some videos to loop so I thought that rewinding them when this flag will go back to false should do the trick but it never comes back to false...
Even though it did mark as finished for me, closing love after did cause a hang, so I debugged that and I just committed a fix. That should also make sure isPlaying is false, but I couldn't confirm that.