we’re encountering problems with the implementation of the media player framework for the unreal engine and iOS16. What the guys at epic are doing is basically calling
to start preloading. At this point the player doesn’t call the completionHandler anymore reliable since the release of iOS 16. Before everything was working flawless, but now most of the time the asset loading fails without errors. Any thoughts what might have changed with ios16? Probably it’s due to some threading issue. Any help highly welcome!
At least, we’re not alone It’s a custom build of the 4.26 branch. We still try to alter the AVMediaPlayer Plugin on a few lines, but so far it really doesn’t look very promising…
Could you check if this helps in your project too. It basically disables the prerolling in the avfmediaplayer. In our test project it was working, in the final project, it was still misbehaving, so it might not fix completely.
Copy the Plugin from the Engine to your Project Plugins Folder
C:\Program Files\Epic Games[VERSION]\Engine\Plugins\Media\AvfMedia
Than replace the AvfMedia\Source\AvfMedia\Private\Player\AvfMediaPlayer.cpp with the attached file.
Yes, the altered Plugin fixes it. Since the newest MacOS version the MediaPlayer is broken there too, but can be fixed exactly the same way than on iOS. Just remove the if #if PLATFORM_MAC code block and the #else/#endif and it should work.
Hi everyone.
I was going crazy on these video bugs until I found your posts. Thanks so much!
I followed the instructions but now I am getting these errors while building for iOS.
Do you have a solution for that, too? I would really appreciate it! ;-D
[2/9] Compile Module.AvfMediaFactory.cpp
UATHelper: Packaging (iOS): In file included from C:\***\Plugins\AvfMedia\Intermediate\Build\IOS\UE4\Shipping\AvfMedia\Module.AvfMedia.cpp:3:
UATHelper: Packaging (iOS): C:\***\Plugins\AvfMedia\Source\AvfMedia\Private\Player\AvfMediaPlayer.cpp:396:67: error: use of undeclared identifier 'GetAvfMediaPlayerDebugData'
UATHelper: Packaging (iOS): UE_LOG(LogTemp, Warning, TEXT("State of AVFMediaPlayer is %s"), *GetAvfMediaPlayerDebugData());
UATHelper: Packaging (iOS): ^
UATHelper: Packaging (iOS): C:\***\Plugins\AvfMedia\Source\AvfMedia\Private\Player\AvfMediaPlayer.cpp:614:9: error: use of undeclared identifier 'GetAvfMediaPlayerDebugData'
UATHelper: Packaging (iOS): return GetAvfMediaPlayerDebugData();
UATHelper: Packaging (iOS): ^
PackagingResults: Error: use of undeclared identifier 'GetAvfMediaPlayerDebugData'
PackagingResults: Error: use of undeclared identifier 'GetAvfMediaPlayerDebugData'
UATHelper: Packaging (iOS): C:\***\Plugins\AvfMedia\Source\AvfMedia\Private\Player\AvfMediaPlayer.cpp:623:26: error: out-of-line definition of 'GetAvfMediaPlayerDebugData' does not match any declaration in 'FAvfMediaPlayer'
UATHelper: Packaging (iOS): FString FAvfMediaPlayer::GetAvfMediaPlayerDebugData() const
UATHelper: Packaging (iOS): ^~~~~~~~~~~~~~~~~~~~~~~~~~
PackagingResults: Error: out-of-line definition of 'GetAvfMediaPlayerDebugData' does not match any declaration in 'FAvfMediaPlayer'
UATHelper: Packaging (iOS): 3 errors generated.
Ah, sorry about that. We added a new function for further debugging. Just delete the whole GetAvfMediaPlayerDebugData function from the cpp file. The error occures because the function is not defined in the AvfMediaPlayer.h file. Or use the attached plugin, it’s the one we are using currently. AvfMedia.zip (46.4 KB)