You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This is an API breaking change. If you previously experimented with media assets, you will have to rebuild your Blueprints, UMG widgets, etc. If you don't want to lose your existing Blueprints, you can add the following line to your project's Engine.ini, which will map the old class name to the new one (you will still need to replace existing MediaAsset nodes with MediaPlayer nodes): [/Script/Engine.Engine] +ActiveClassRedirects=(OldClassName="MediaAsset",NewClassName="MediaPlayer") [CL 2291399 by Max Preussner in Main branch]
63 lines
1.1 KiB
C++
63 lines
1.1 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "MediaAssetsPrivatePCH.h"
|
|
#include "ModuleManager.h"
|
|
|
|
|
|
/**
|
|
* Implements the MediaAssets module.
|
|
*/
|
|
class FMediaAssetsModule
|
|
: public FSelfRegisteringExec
|
|
, public IModuleInterface
|
|
{
|
|
public:
|
|
|
|
// FSelfRegisteringExec interface
|
|
|
|
virtual bool Exec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) override
|
|
{
|
|
if (FParse::Command(&Cmd, TEXT("MEDIA")))
|
|
{
|
|
FString MovieCmd = FParse::Token(Cmd, 0);
|
|
|
|
if (MovieCmd.Contains(TEXT("PLAY")))
|
|
{
|
|
for (TObjectIterator<UMediaPlayer> It; It; ++It)
|
|
{
|
|
UMediaPlayer* MediaPlayer = *It;
|
|
MediaPlayer->Play();
|
|
}
|
|
}
|
|
else if (MovieCmd.Contains(TEXT("PAUSE")))
|
|
{
|
|
for (TObjectIterator<UMediaPlayer> It; It; ++It)
|
|
{
|
|
UMediaPlayer* MediaPlayer = *It;
|
|
MediaPlayer->Pause();
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public:
|
|
|
|
// IModuleInterface interface
|
|
|
|
virtual void StartupModule( ) override { }
|
|
|
|
virtual void ShutdownModule( ) override { }
|
|
|
|
virtual bool SupportsDynamicReloading( ) override
|
|
{
|
|
return false;
|
|
}
|
|
};
|
|
|
|
|
|
IMPLEMENT_MODULE(FMediaAssetsModule, MediaAssets);
|