Problems playing 2 videos with a Theora control
by Stephen Bjore · in Torque Game Engine · 10/12/2006 (12:30 pm) · 0 replies
I'm having a problem playing two video files using a guiTheoraCtrl, one after the other (the first is a logo video, the second the introduction to the game).
I have a GUI which contains the guiTheoraCtrl, 'theora_video', and when it is loaded, it starts playing the first video and schedules a function to run in 100ms. The function checks to see if 'theora_video.done' is true. If it isn't, then it will schedule itself to run again in 100ms. If it is true, then it will either load the second video and schedule itself again, or pop the GUI.
The problem comes in when I call 'theora_video.setFile("file2.ogg")' and schedule the function to run again, the next time in the function, 'theora_video.done' will be true (even though this is long before the movie is really done).
One odd thing that I noticed while trying to figure out why this doesn't work is that if I set a breakpoint (in Torsion) where I call 'theora_video.setFile("file2.ogg")', and then step over that line, then everything works as expected (the next time the function is called, 'theora_video.done' is false). However, if I break at that line, then hit F5 (to run the program, instead of stepping), then 'theora_video.done' is true, exactly like the case where I don't break at all. I have no idea if that information is useful, but it's at least peculiar.
Finally, I tried creating two guiTheoraCtrls to switch between, and noticed exactly the same behavior.
So, any help to get two videos to play back-to-back would be appeciated!
Thanks,
-Steve
I have a GUI which contains the guiTheoraCtrl, 'theora_video', and when it is loaded, it starts playing the first video and schedules a function to run in 100ms. The function checks to see if 'theora_video.done' is true. If it isn't, then it will schedule itself to run again in 100ms. If it is true, then it will either load the second video and schedule itself again, or pop the GUI.
The problem comes in when I call 'theora_video.setFile("file2.ogg")' and schedule the function to run again, the next time in the function, 'theora_video.done' will be true (even though this is long before the movie is really done).
One odd thing that I noticed while trying to figure out why this doesn't work is that if I set a breakpoint (in Torsion) where I call 'theora_video.setFile("file2.ogg")', and then step over that line, then everything works as expected (the next time the function is called, 'theora_video.done' is false). However, if I break at that line, then hit F5 (to run the program, instead of stepping), then 'theora_video.done' is true, exactly like the case where I don't break at all. I have no idea if that information is useful, but it's at least peculiar.
Finally, I tried creating two guiTheoraCtrls to switch between, and noticed exactly the same behavior.
So, any help to get two videos to play back-to-back would be appeciated!
Thanks,
-Steve
About the author