So I’ve been searching for some time trying to port my XNA game to linux, everything runs nice and smoothly and the last thing there is to port are the videos which I use at the end of every stage. But after some research ir appears that the VideoPlayer class wan’t implemented yet on the DesktopGL version.
I’ve hear that there is a way to use SDL2 to play videos but couldn’t find anything about it anywhere.
So, is there a solution to play videos on the Linux platform?
Thanks for your reply, sampereira, a while back I’ve read those posts about adding TheoraPlay to the project, it were just a week later after I’ve updated the project to 3.6, I had no idea that it weren’t working because I was on version that version.
The problem is that I working on I’m planing to add the Penumbra light engine to to the game, and it requires the version 3.6. (Krypton is giving me a headache)
Still, I would LOVE could upload a working sample, if it works I’ll definitely come back to 3.5.1 again.
Here is the sample game with video working in Linux:
I remember you that the video needs to be encoded with Theora.
I’ve used VLC to convert my videos.
I’ve precompiled MonoGame 3.5.1 with the changes to include it with the sample game, so you can just open the game project and run it.
The video used in the game is from the TheoraTestSuite. You can get more from here: https://wiki.xiph.org/TheoraTestsuite
If you prefer to compile MonoGame with this change for yourself:
Clone MonoGame 3.5.1 from the repository
Generate the solution with Protobuild
Open MonoGame.Framework.Linux.sln and under Media create a new directory Xiph
Add the 3 files included in MonoGameLinuxVideoTheora/src/Media/Xiph
Compile it and use it in your project
The credits should go to the FNA maintainer flibitijibibo and termoventilador for the other topics about this.
I tried it with MonoGame 3.6 but it only works if you comment #define VIDEOPLAYER_OPENGL in both Video.cs and VideoPlayer.cs so it uses the TheoraPlay software converter and avoids all the GL. mess… but it’s a lot slower…
Maybe someone more experienced than me can give some help with the missing OpenGL functions…
I did get it working commenting #define VIDEOPLAYER_OPENGL and I can’t thank you enough as for today I have a release candidate for my linux port. But I have another question for you, now that the linux port is almost over, the Mac port begins, and I can’t find the .dylib version of the dll, do I have to compile my own?
Do yo happen to have the .dylib version too?