Best workflow for StreamMediaSources?

Hi everyone,
I have a small game where I have some videos playing as textures. When I use the FileMediaSources my launched Project is 1,5GB big on my Android phone. I have also checked the compressed cooked packages.
When I switch the videos I have a delay of about a second.
Now I use the StreamMediaFiles instead of the FMS and my project is just 128 MB big. But when I switch the videos it takes about 5 seconds to load the new video.

So my question to you out there: Is there a way to decrease the time it takes the engine to load the videos with the SMS? It does not offer the ability to precache the files so the only idea I have is to open all of the sources at the game start and then switch between them.

Has anybody some solution?


The delay may be caused by the media player attempting to get track information on opening the video. In you can change setDataSourceURL() by removing this code and see it if improves:

if (android.os.Build.VERSION.SDK_INT >= 16)
	MediaExtractor extractor = new MediaExtractor();
	if (extractor != null)
		extractor = null;

Oh thanks!
But I where can i find the mediaPlayer14? I am using a BluePrint project and no C++. Or is it in the engine files?

Ok I found it in the engine binaries :smiley:
I will test it and come back here again :wink:

It felt like I had no improvement on the time it took to switch between the videos.
I have set back my project to the normal FileMediaSources and now I try to profile my app.
The heaviest call is the “CompressDataAndSendToGame”. Is this the MediaSource sending the video to my texture?

That call is the profiler compressing the capture data; you can ignore it.