so i trying to develop a game and one of the features is video on the level's background, i was implementing the logic of pause menu (You can roast me btw):
Code: Select all
local function advanceTime(dt)
if type("mediaContent") then
local success, res = pcall(mediaContent.tell, mediaContent)
if success then
elapsedTime = res or 0
else
print(res)
end
--What i added, that caused the mayhem
if type(menu) == "table" then
if menu.show then
waveSource:pause()
mediaContent:pause()
else
mediaContent:play()
waveSource:play()
end
end
end
end
Code: Select all
play()
Also the fix was dirty cheap for those wondering (roast allowed again):
Code: Select all
local function advanceTime(dt)
if type("mediaContent") then
local success, res = pcall(mediaContent.tell, mediaContent)
if success then
elapsedTime = res or 0
else
print(res)
end
if type(menu) == "table" then
if menu.show then
waveSource:pause()
mediaContent:pause()
else
if mediaContent:tell() > 0 and not mediaContent:isPlaying() then
mediaContent:play()
waveSource:play()
end
end
end
end
end