Download

WmfMediaPlayer - opening HTTP URLs

Having difficulty opening an external HTTP URI to stream content into a MediaPlayer instance. This is supposedly supported from reading the documentation, however my MediaPlayer always seems to prepend the project’s Content directory (or the Engine location, when debugging) to any URI that I pass. In all of these examples, the video I’m attempting to open is http://tom.net.nz/uploads/private/raft.3gp

When I enter the URI into the media player properties, the location changes as soon as I focus away from the property, like so:

3debea7e60c7cfd77700b18038b417a91be27881.png

I’ve also tried to explicitly set the URL using a Blueprint:

5s9CmL1.png

In this case, I can see from the log that the folder still gets prepended to the URL (from the Output Log):

I’ve tried debugging various parts of the underlying C++ code, but I’m not sure what is adding this directory, or how to prevent it. Any ideas?

In theory this kind of operation should be supported for MediaPlayer. From the Wiki:

Actually, I’ve found where the issue arises:

In MediaPlayer.cpp, I see the following:


		// open the new media file
		const FString FullUrl = FPaths::ConvertRelativePathToFull(FPaths::IsRelative(URL) ? FPaths::GameContentDir() / URL : URL);
		bool OpenedSuccessfully = false;

		if (StreamMode == EMediaPlayerStreamModes::MASM_FromUrl)
		{
			OpenedSuccessfully = Player->Open(FPaths::ConvertRelativePathToFull(FullUrl));
		}

If I change it to just use Player->Open(URL) instead of the converted URL, then it opens the stream just fine… I feel like this code should detect an external URI and not attempt to do a path conversion in that case. Any advice for the right way to do this within Unreal? In the meantime I’ll use my hacked editor code :slight_smile: