So I checked the API reference for libtheoraplayer and found out that there is support for loading from memory, just that it is not so direct. So with a little coding, I've implemented both the original(from libtheoraplayer) load from TheoraDataSource, and a simplified load from data(by providing a pointer and data size).
What is SFMLTheora?
Basically, it's a few classes for loading theora(ogg/ogv) video files using the libtheoraplayer(http://sourceforge.net/apps/mediawiki/libtheoraplayer/index.php?title=Main_Page) and displaying it using the SFML library(http://www.sfml-dev.org/).
Discussion in SFML forums:
08/09/2011 - Fixed support for SFML 1.6.
Download (comes with an example on how to use it):
Newer version available: http://www.zorexxlkl.com/2011/09/sfmltheora-13.html
Just thought of making a short tutorial.
SFMLTheora is very easy and straight forward to use, first, create an Video instance:
SFMLTheora::Video* testVid = new SFMLTheora::Video();
if (testVid == NULL)
Starting from SFMLTheora 1.1.1, Init() is automatically called in LoadClip() if it hasn't been called yet.
Then load your video:
Now, in your game loop, add this line:
or, for SFML2 as of 24/5/2011 (time is in Uint32 milliseconds instead of float seconds):
testVid->Update(sfApp.GetFrameTime() / 1000.0f);
or, if you use a fixed framerate (e.g. 60 fps):
testVid->Update(1.0f / 60.0f);
Draw it! (in your game loop where you draw other things)
Finally, when you're done with it, delete it:
testVid = NULL;
That's all! It's just that simple.