4.13 Media Textures on iOS

Hey everyone:

So I have been trying to figure out how to use media textures on 4.13 for an iOS application using a mac for development. I run through the typical steps:

  1. Create a Movies folder in the contents.
  2. Add the .mov file in this new folder.
  3. Open the project and import this same file to the Movies folder.
  4. It comes in as a File Media Source and I change the save location to the project local save location by reloading the file from the project contents movies folder.
  5. I create a Media Player and open. It says no media in left corner and in right says AvfMedia.
  6. I double click my videos file media source, which is below the viewport.
  7. The video begins to play, however both below and now in the URL input of the viewport, it has the desktop save location instead of the ‘./Movies’ location of the video file (still in the file media source, the file path is the ./Movies). Changing the URL in the Media Player viewport crashes UE4 for me.
  8. Anyways, I proceed, and from there, right click the media player to create a media texture.
  9. And then right click it to create the material.
  10. I add the video into the scene. At this point the material is working and the video is playing on the mesh it was assigned to. And saving the project still allows everything in working order.
  11. Also, I have added the blueprint in the level that tells the media player to play at a rate of 1 when begin play. I have had success with this blueprint and this same setup on a windows machine, so I dont think this is the issue.
  12. BUT when pressing play in editor, the material goes back and the media player says no media. So i am assuming this is a bug with the media player? Or the URL file location? Or (hopefully) Im just doing something wrong?
  13. Nothing works.
  14. I must reset the URL in the media player. And it all works again, until I press play, or package, or anything…

Any ideas?

Thanks,

Hey Bamwd5,

So I just ran some tests on my end using a project I had set up for this exactly workflow. In my case I am actually rendering the entire movie in fullscreen using UMG, but the general principal is the same and requires the same file directory set up to work as expected.

Media Source Directory

Here I have made sure all of my Media files are within the Content/Movies folder and the path for the Media Source asset points to the video within my Unreal Project’s Engine/Content/Movies directory.

Media Player - UMG

Here you can see I have created a Media Player variable and called the Open Source node referencing the specified Media Source asset. I then call it to Play along with the associated Media Sound Wave.

Media Player - Level Blueprint

Finally within the level blueprint I simply create the Widget Blueprint and call it to render to the viewport. The option controls like the ‘Quit Game’ node can be triggered via touch inputs or other miscellaneous events. I then Packaged under the Shipping Configuration and deployed the packaged ipa to the device. The result is my video plays upon launching the loaded default level.

Hopefully this helps clarify the process, but let me know if you have further questions or need additional assistance.

Cheers,

  1. It comes in as a File Media Source and I change the save location to the project local save location by reloading
    the file from the project contents movies folder.

This is a bug. The path should already be saved as relative to /Content/Movies. I’ll try to get this fixed in the next 4.13 hotfix.

  1. The video begins to play, however both below and now in the URL input of the viewport, it has the desktop save
    location instead of the ‘./Movies’ location of the video file (still in the file media source, the file path is the ./Movies).

This is OK. The viewport will always display the full URL, even if the file path stored in the asset is relative. For the ‘Url’ field in the media library tab I may change it to display the actual string stored in the asset, so that there’s no confusion. I’ll think about it some more.

Changing the URL in the Media Player viewport crashes UE4 for me.

Could you please send me the log file of the crash?

  1. Also, I have added the blueprint in the level that tells the media player to play
    at a rate of 1 when begin play. I have had success with this blueprint and this
    same setup on a windows machine, so I dont think this is the issue.

Don’t do this. Either enable “PlayOnOpen” on the MediaPlayer asset and call Open from BeginPlay, or hook into the MediaPlayer’s OnMediaOpened event and call Play from there. It takes some time to open a media source (especially if it is streamed), so you cannot call Play right away (it will simply return false).

For tracking purposes you can track the bug entered for the Media Source file path bug by following the link below.

UE-35477

Thanks,

Fixed in the next hotfix.

Please still send me the log file for the crash. That seems to be a separate issue. Thanks!

Calling Play right after OpenSource is not going to work. You should either enable “PlayOnOpen” in the MediaPlayer asset, or hook into the OnMediaOpened event and call Play from there.

OpenSource, OpenUrl, and OpenPlaylist are asynchronous operations that may take some time to complete, especially if the media is coming from the internet.