I created a MediaPlayer asset from a .wmv file that exists in my Content/Movies folder. I have this set to AutoPlay = true, AutoPlayRate = 1.0, and Looping = true. The source is a relative file path, and the StreamMode is fromUrl.
I then created a media texture from my MediaPlayer file, and then created a material from that. I then set that material’s properties to emissive, and break the link to BaseColor.
When I use this MediaPlayer asset in an image widget in the UMG editor, it plays fine, and it works even in PIE. It also works in Standalone Game.
PROBLEM: When we create our baked builds, all images referencing the material from the MediaPlayer asset’s texture just show black instead of playing the video. I checked the files inside of our baked build, and all the .wmv files are in the right places.
This error will randomly crash your game after a while of the video playing. Pretty sure it’s memory leaks somewhere.
The fix is to call OpenURL with the correct URL on the mediaplayer variable when you initialize the widget. For some reason, in baked builds this never gets called on constructing a mediplayer, but it does get called in PIE.
My issue was different (random crashes in shipping builds when OpenLevel was called subsequent to any MediaPlayer activity) and so far, calling OpenURL on the movie asset before playing seems to have helped.
For reference, the URL format is “./Movies/YourMovieName.wmv”. Also remember to place your raw movie file inside Content/Movies for it to be included in the packaging process, otherwise you’ll get a black image.