Startup movies not playing in iOS

Startup movies are not playing in iOS, but they work fine on other platforms.

After debugging I found the issue in BinkMovieStreamer. The paths used to search for the bink asset file are incorrect.

The following lines in BinkMovieStreamer.cpp

241| FString ExternalPath = PlatformFile.ConvertToAbsolutePathForExternalAppForRead(*FullMoviePath);
242| if (FPlatformFileManager::Get().GetPlatformFile().FileExists(*ExternalPath))
243| {
...
252| FString CookPath = *BinkUE4CookOnTheFlyPath(FPaths::ConvertRelativePathToFull(BINKMOVIEPATH), *MoviePathTbl[i]);
253| ExternalPath = PlatformFile.ConvertToAbsolutePathForExternalAppForRead(*FullMoviePath);
254| if (FPlatformFileManager::Get().GetPlatformFile().FileExists(*ExternalPath)) 
255| {


Should be replaced with the following:

241| if (FPlatformFileManager::Get().GetPlatformFile().FileExists(*FullMoviePath)) 
242| {
243|     const FString ExternalPath = PlatformFile.ConvertToAbsolutePathForExternalAppForRead(*FullMoviePath);
...
252| FString CookPath = *BinkUE4CookOnTheFlyPath(FPaths::ConvertRelativePathToFull(BINKMOVIEPATH), *MoviePathTbl[i]);
253| if (FPlatformFileManager::Get().GetPlatformFile().FileExists(*CookPath)) 
254| {
255|     const FString ExternalPath = PlatformFile.ConvertToAbsolutePathForExternalAppForRead(*CookPath);

Steps to Reproduce

  • Use any project as a base, with the bink plugin enabled
  • Import a video as a bink asset (any video works)
  • Add the video as a startup movie (Project Settings > Project - Movies > Movies > Startup Movies)
  • Package the project and launch it in an iOS device
  • Observe startup movie does not play

Hi Esteban,

Thanks for the report. I do see a clear bug when falling back to the CookPath code path. However, the initial condition based on FullMoviePath seems to work against a .nk2 free file. Can you confirm your packaging settings that are triggering an issue?

Best regards.

Hi Stéphane,

The packaging settings were left as default, it can be reproduced in a new blank project. We created the builds from XCode, and saw the issue both running in a device locally and running a package uploaded through TestFlight.

The problem seems to be that FileExists requires a relative path to work on iOS, while in Windows it works both with relative and absolute paths. So, the ConvertToAbsolutePathForExternalAppForRead call needs to happen after the check to work on all platforms.

Hope this is enough information to reproduce and confirm whether fix is correct or not.

Thanks

Thanks Esteban,

Your proposed fix has been integrated at CL 48469063.

Best regards.