Hey guys!
So I've noticed lately that whenever I try to incorporate a video into my code, Love decides to crash completely. And I'm not talking about a blue screen error, I'm talking about a "Love.exe has stopped responding." I've looked all over the internet and I couldn't find a solution, as well as tried out using many different videos. Here's an example of a code that causes it to crash:
mTimer = 0
function love.load()
love.window.setMode(1280, 720)
Loading = love.graphics.newVideo('Loading.mp4')
end
function love.update(dt)
Mtimer = Mtimer + dt
if Mtimer < 10 then
Loading:play()
end
if Mtimer > 10 then
Loading:stop()
end
end
function love.draw()
love.graphics.draw(Loading, 10, 10)
end
Any help would be greatly appreciated! I can also send any info if needed.
Last edited by Smy on Mon May 25, 2020 6:33 am, edited 1 time in total.
Not sure if this is the problem, but don't you want to check Video:isPlaying() in those if tests, so it only starts playing if it's not playing, and is only stopped if it's playing?
function love.load()
loading = love.graphics.newVideo('Loading.mp4')
loading:play()
end
function love.update(dt)
timer = timer + dt
if timer > 10 and loading:isPlaying() then
loaing:stop()
end
end
function love.load()
loading = love.graphics.newVideo('Loading.mp4')
loading:play()
end
function love.update(dt)
timer = timer + dt
if timer > 10 and loading:isPlaying() then
loaing:stop()
end
end
Oh yeah! Don't know what I was thinking programming it like that Thanks for the suggestion!
slime wrote: ↑Fri May 22, 2020 12:47 am
mp4 videos aren't supported by love - currently it only supports Ogg Theora (which normally has the .ogv extension).
Aw, that's a shame. Thanks for letting me know though! I'll try to find a work around where I can use an .ogv video rather than a .mp4 one.