Video Player - IsLoop property implemented?

Good day,

I recently moved over to monogame from XNA developing for Windows desktop mainly,

I’ve been searching all over for a solution and I was hoping someone here might point me in the right direction. I’ve read many posts that I could find with no real solution.

I’m trying to play a video in monogame (loop). I’ve noticed huge memory leaks ‘trying’ to loop the video via update function (player.state == Mediastate.stopped).

My problem is, is the property “IsLoop” implemented? I’ve tried both C# and VB with no luck.

My specs are:
OS: Windows 10 x64
Monogame: v3.7.1
VS: 2017

A snippet of code with my error:

I’ll appreciate any input.


The only work around I could find is to use ffmpeg to split the video into sprite frames and play them separately in sequence to simulate a video.

Is this the only alternative besides not having the “IsLoop” option for video? What am I missing?

I’m really curious if there is anybody that managed to make it work. I’ve tried many options proposed by this community but none are working.

How seamless does the loop need to be? Call play, poll the current state until its no longer playing – call play again.

That was one of my first attempts. Are you suggesting polling via update method or timer?

I tried the update route:

This works fine, the problem is the memory. It starts off with +/- 80Mb, when the video plays a second time, the memory jumps to +/-130Mb and continues to do so every time the video plays again…180MB…220MB…and grows.

I was hoping upgrading to Monogame v3.8.0.626 might resolve my issue, but no luck.

Anybody else having the same issue when playing video? How do you play video looped?

This sounds like a pretty serious bug, you should ask here instead and it might get fixed

Call dispose on the video player first. If that doesn’t work, allocate a new one.

I do believe if you are only targeting one platform, you could just use more direct play methods? been a while so unable to expand on that theory but perhaps try a more direct approach? or are you trying to RT the video into a scene?

Are you pre-processing the video through the pipeline I think is what I mean, just try referencing the original video?

Haven’t been on the forum for some time.

I’m back to square one with the memory leak on the video player. Many of my previous project uses “video” as background.

I’ve tried all sort of things but no luck. Removing everything code-wise and just playing the video player (no draw implementation or sprites etc) still causes memory leak by itself. Everything else I need to do can be done in Monogame expect for the “video player” issue.

I’ve also tried the dispose and allocate new player as suggested but then the player can’t play the video second time. Unless I’m missing something here.

Also tried the same with C# and VB to see if it’s language specific, but the same.

I also tried a forum user’s code snippet hoping it was implemented differently but have the same leak.

Does anyone have a code-snippet where it is actually works - no leak?

My problem with the memory leak when playing video has been resolved.

A huge thanks for this article. MonoGame.Extended.VideoPlayback