UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IMediaPlayerFactory Class Referenceabstract

#include <IMediaPlayerFactory.h>

Public Member Functions

virtual bool CanPlayUrl (const FString &Url, const IMediaOptions *Options, TArray< FText > *OutWarnings, TArray< FText > *OutErrors) const =0
 
virtual TSharedPtr< IMediaPlayer, ESPMode::ThreadSafeCreatePlayer (IMediaEventSink &EventSink)=0
 
virtual FText GetDisplayName () const =0
 
virtual FName GetPlayerName () const =0
 
virtual FGuid GetPlayerPluginGUID () const =0
 
virtual const TArray< FString > & GetSupportedPlatforms () const =0
 
virtual bool SupportsFeature (EMediaFeature Feature) const =0
 
bool CanPlayUrl (const FString &Url, const IMediaOptions *Options) const
 
virtual int32 GetPlayabilityConfidenceScore (const FString &Url, const IMediaOptions *Options, TArray< FText > *OutWarnings, TArray< FText > *OutErrors) const
 
bool SupportsPlatform (const FString &PlatformName) const
 
virtual ~IMediaPlayerFactory ()
 

Detailed Description

Interface for media player factories.

Media player factories are used to create instances of media player implementations. Most media players will be implemented inside plug-ins, which will register their factories on startup. The Media module will use the CanPlayUrl() method on this interface to determine which media player to instantiate for a given media source.

See also
IMediaPlayer

Constructor & Destructor Documentation

◆ ~IMediaPlayerFactory()

virtual IMediaPlayerFactory::~IMediaPlayerFactory ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ CanPlayUrl() [1/2]

bool IMediaPlayerFactory::CanPlayUrl ( const FString &  Url,
const IMediaOptions Options 
) const
inline

Whether the player can play the specified source URL.

Parameters
UrlThe media source URL to check.
OptionsOptional media player parameters.
Returns
true if the source can be played, false otherwise.

◆ CanPlayUrl() [2/2]

virtual bool IMediaPlayerFactory::CanPlayUrl ( const FString &  Url,
const IMediaOptions Options,
TArray< FText > *  OutWarnings,
TArray< FText > *  OutErrors 
) const
pure virtual

Whether the player can play the specified source URL.

Parameters
UrlThe media source URL to check.
OptionsOptional media player parameters.
OutWarningsWill contain warning messages (optional).
OutErrorswill contain error messages (optional).
Returns
true if the source can be played, false otherwise.

◆ CreatePlayer()

virtual TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > IMediaPlayerFactory::CreatePlayer ( IMediaEventSink EventSink)
pure virtual

Creates a media player.

Parameters
EventSinkThe object that will receive the player's events.
Returns
A new media player, or nullptr if a player couldn't be created.

◆ GetDisplayName()

virtual FText IMediaPlayerFactory::GetDisplayName ( ) const
pure virtual

Get the human readable name of the player.

Returns
Display name text.
See also
GetName

◆ GetPlayabilityConfidenceScore()

virtual int32 IMediaPlayerFactory::GetPlayabilityConfidenceScore ( const FString &  Url,
const IMediaOptions Options,
TArray< FText > *  OutWarnings,
TArray< FText > *  OutErrors 
) const
inlinevirtual

Returns a confidence score how sure the player thinks it is to be able to play the specified source URL.

Parameters
UrlThe media source URL to check.
OptionsOptional media player parameters.
OutWarningsWill contain warning messages (optional).
OutErrorswill contain error messages (optional).
Returns
A score giving a probability (0-100 (or higher if necessary)) whether or not the media can be played.

◆ GetPlayerName()

virtual FName IMediaPlayerFactory::GetPlayerName ( ) const
pure virtual

Get the unique name of the media player.

Returns
Media player name, i.e. 'AndroidMedia' or 'WmfMedia'.
See also
GetDisplayName

◆ GetPlayerPluginGUID()

virtual FGuid IMediaPlayerFactory::GetPlayerPluginGUID ( ) const
pure virtual

Get the GUID for this player plugin.

Returns
Media player GUID (usually corresponds to a player name)
See also
GetPlayerName

◆ GetSupportedPlatforms()

virtual const TArray< FString > & IMediaPlayerFactory::GetSupportedPlatforms ( ) const
pure virtual

Get the names of platforms that the media player supports.

The returned platforms names must match the ones returned by FPlatformProperties::IniPlatformName, i.e. "Windows", "Android", etc.

Returns
Platform name collection.
See also
GetOptionalParameters, GetRequiredParameters, GetSupportedFileExtensions, GetSupportedUriSchemes

◆ SupportsFeature()

virtual bool IMediaPlayerFactory::SupportsFeature ( EMediaFeature  Feature) const
pure virtual

Check whether the media player supports the specified feature.

Parameters
FeatureThe feature to check.
Returns
true if the feature is supported, false otherwise.

◆ SupportsPlatform()

bool IMediaPlayerFactory::SupportsPlatform ( const FString &  PlatformName) const
inline

Whether the player works on the given platform.

Parameters
PlatformNameThe name of the platform to check.
Returns
true if the platform is supported, false otherwise.
See also
GetSupportedPlatforms

The documentation for this class was generated from the following file: