VideoPlayer GetTexture returns null

I’m just trying to play an mp4 video in my game, but GetTexture always returns null no matter what.

Surely mp4 is supported? And if it isn’t, will I have to convert it to another video type?



I’ve never personally done it, so done a quick google for you as I didn’t think what you were doing was right.

I found this on stack overflow:

Which then lead me to the below site from one of the answers:

Open the “Game1.cs” file at the above github site and see how they are playing the video.

In the loadContent put:

video = Content.Load<Video> ("sintel_trailer");
videoPlayer = new Microsoft.Xna.Framework.Media.VideoPlayer();
playVideo = true;

And in the update method put:

if (playVideo)
if (videoPlayer.State == MediaState.Stopped)
playVideo = false;

Note: The stackoverflow question is now 5 years old so it might not work 100%, if not I’m sure one of the more regular monogame users will reply and correct me. :slight_smile:

Hope this helps.