When attempting to use a media player asset in code, packaging will fail with the error message shown below.
Could not find a native player for [...]4.13/Content/Movies/Tutorial.wmv
This occurs even if the Desired Player Name is set, and after ensuring the plugins are included.
class UMediaPlayer* TestMP; class UMediaTexture* TestMT; class UFileMediaSource* SourceFile;
#include "MyProject2.h" #include "Runtime/MediaAssets/Public/MediaPlayer.h" #include "Runtime/MediaAssets/Public/MediaTexture.h" #include "Runtime/MediaAssets/Public/FileMediaSource.h" #include "MyActor.h" // Sets default values AMyActor::AMyActor() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; static ConstructorHelpers::FObjectFinder<UMediaPlayer> MPAsset(TEXT("MediaPlayer'/Game/FirstPersonBP/TestMP.TestMP'")); if (MPAsset.Succeeded()) { TestMP = MPAsset.Object; } static ConstructorHelpers::FObjectFinder<UMediaTexture> MTAsset(TEXT("MediaTexture'/Game/FirstPersonBP/TestMP_Video.TestMP_Video'")); if (MTAsset.Succeeded()) { TestMT = MTAsset.Object; } static ConstructorHelpers::FObjectFinder<UFileMediaSource> MSAsset(TEXT("FileMediaSource'/Game/FirstPersonBP/Unreal_MP4_TestVideo.Unreal_MP4_TestVideo'")); if (MSAsset.Succeeded()) { SourceFile = MSAsset.Object; } TestMP->OpenSource(SourceFile); TestMP->DesiredPlayerName = FName("WMFMedia"); }
Result: Notice that you'll get an error message along these lines:
Could not find a native player for [...]4.13/Content/Movies/Tutorial.wmv
Expected: Packaging would complete.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | Media Framework |
---|---|
Affects Versions | 4.13 |
Created | Sep 13, 2016 |
---|---|
Resolved | Sep 13, 2016 |
Updated | May 2, 2018 |