UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMediaPlayerFacade Class Reference

#include <MediaPlayerFacade.h>

+ Inheritance diagram for FMediaPlayerFacade:

Public Member Functions

MEDIAUTILS_API FMediaPlayerFacade (TWeakObjectPtr< UMediaPlayer > InMediaPlayer)
 
virtual MEDIAUTILS_API ~FMediaPlayerFacade ()
 
MEDIAUTILS_API void AddAudioSampleSink (const TSharedRef< FMediaAudioSampleSink, ESPMode::ThreadSafe > &SampleSink)
 
MEDIAUTILS_API void AddCaptionSampleSink (const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &SampleSink)
 
MEDIAUTILS_API void AddMetadataSampleSink (const TSharedRef< FMediaBinarySampleSink, ESPMode::ThreadSafe > &SampleSink)
 
MEDIAUTILS_API void AddSubtitleSampleSink (const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &SampleSink)
 
MEDIAUTILS_API void AddVideoSampleSink (const TSharedRef< FMediaTextureSampleSink, ESPMode::ThreadSafe > &SampleSink)
 
MEDIAUTILS_API bool CanPause () const
 
MEDIAUTILS_API bool CanPlayUrl (const FString &Url, const IMediaOptions *Options)
 
MEDIAUTILS_API bool CanResume () const
 
MEDIAUTILS_API bool CanScrub () const
 
MEDIAUTILS_API bool CanSeek () const
 
MEDIAUTILS_API bool SupportsPlaybackTimeRange () const
 
MEDIAUTILS_API void Close ()
 
MEDIAUTILS_API uint32 GetAudioTrackChannels (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API uint32 GetAudioTrackSampleRate (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API FString GetAudioTrackType (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API FTimespan GetDuration () const
 
MEDIAUTILS_API const FGuidGetGuid ()
 
MEDIAUTILS_API FString GetInfo () const
 
MEDIAUTILS_API FVariant GetMediaInfo (FName InfoName) const
 
MEDIAUTILS_API FText GetMediaName () const
 
MEDIAUTILS_API TSharedPtr< TMap< FString, TArray< TUniquePtr< IMediaMetadataItem > > >, ESPMode::ThreadSafeGetMediaMetadata () const
 
MEDIAUTILS_API int32 GetNumTracks (EMediaTrackType TrackType) const
 
MEDIAUTILS_API int32 GetNumTrackFormats (EMediaTrackType TrackType, int32 TrackIndex) const
 
TSharedPtr< IMediaPlayer, ESPMode::ThreadSafeGetPlayer () const
 
MEDIAUTILS_API FName GetPlayerName () const
 
MEDIAUTILS_API float GetRate () const
 
MEDIAUTILS_API int32 GetSelectedTrack (EMediaTrackType TrackType) const
 
MEDIAUTILS_API FString GetStats () const
 
MEDIAUTILS_API TRangeSet< floatGetSupportedRates (bool Unthinned=true) const
 
MEDIAUTILS_API TRange< FTimespanGetPlaybackTimeRange (EMediaTimeRangeType InRangeToGet) const
 
MEDIAUTILS_API FTimespan GetTime () const
 
MEDIAUTILS_API FMediaTimeStamp GetTimeStamp () const
 
MEDIAUTILS_API FMediaTimeStamp GetDisplayTimeStamp () const
 
MEDIAUTILS_API TOptional< FTimecodeGetVideoTimecode () const
 
MEDIAUTILS_API TRange< FMediaTimeStampGetLastProcessedVideoSampleTimeRange () const
 
MEDIAUTILS_API FText GetTrackDisplayName (EMediaTrackType TrackType, int32 TrackIndex) const
 
MEDIAUTILS_API int32 GetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex) const
 
MEDIAUTILS_API FString GetTrackLanguage (EMediaTrackType TrackType, int32 TrackIndex) const
 
const FString & GetUrl () const
 
MEDIAUTILS_API float GetVideoTrackAspectRatio (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API FIntPoint GetVideoTrackDimensions (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API float GetVideoTrackFrameRate (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API TRange< floatGetVideoTrackFrameRates (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API FString GetVideoTrackType (int32 TrackIndex, int32 FormatIndex) const
 
MEDIAUTILS_API bool GetViewField (float &OutHorizontal, float &OutVertical) const
 
MEDIAUTILS_API bool GetViewOrientation (FQuat &OutOrientation) const
 
MEDIAUTILS_API bool HasError () const
 
MEDIAUTILS_API bool IsBuffering () const
 
MEDIAUTILS_API bool IsConnecting () const
 
MEDIAUTILS_API bool IsLooping () const
 
MEDIAUTILS_API bool IsPaused () const
 
MEDIAUTILS_API bool IsPlaying () const
 
MEDIAUTILS_API bool IsPreparing () const
 
MEDIAUTILS_API bool IsClosed () const
 
MEDIAUTILS_API bool IsReady () const
 
MEDIAUTILS_API bool Open (const FString &Url, const IMediaOptions *Options, const FMediaPlayerOptions *PlayerOptions=nullptr)
 
MEDIAUTILS_API void QueryCacheState (EMediaTrackType TrackType, EMediaCacheState State, TRangeSet< FTimespan > &OutTimeRanges) const
 
MEDIAUTILS_API bool Seek (const FTimespan &Time)
 
MEDIAUTILS_API bool IsSeeking () const
 
MEDIAUTILS_API FMediaTimeStamp GetSeekTarget () const
 
MEDIAUTILS_API void SetNextSeek (const FTimespan &InTime)
 
MEDIAUTILS_API bool SelectTrack (EMediaTrackType TrackType, int32 TrackIndex)
 
MEDIAUTILS_API void SetBlockOnTime (const FTimespan &Time)
 
MEDIAUTILS_API void SetBlockOnTimeRange (const TRange< FTimespan > &TimeRange)
 
MEDIAUTILS_API void SetCacheWindow (FTimespan Ahead, FTimespan Behind)
 
MEDIAUTILS_API void SetGuid (FGuid &Guid)
 
MEDIAUTILS_API bool SetLooping (bool Looping)
 
MEDIAUTILS_API void SetMediaOptions (const IMediaOptions *Options)
 
MEDIAUTILS_API bool SetRate (float Rate)
 
MEDIAUTILS_API bool SetPlaybackTimeRange (const TRange< FTimespan > &InTimeRange)
 
MEDIAUTILS_API bool SetNativeVolume (float Volume)
 
MEDIAUTILS_API bool SetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex, int32 FormatIndex)
 
MEDIAUTILS_API bool SetVideoTrackFrameRate (int32 TrackIndex, int32 FormatIndex, float FrameRate)
 
MEDIAUTILS_API bool SetViewField (float Horizontal, float Vertical, bool Absolute)
 
MEDIAUTILS_API bool SetViewOrientation (const FQuat &Orientation, bool Absolute)
 
MEDIAUTILS_API bool SupportsRate (float Rate, bool Unthinned) const
 
MEDIAUTILS_API void SetLastAudioRenderedSampleTime (FTimespan SampleTime)
 
MEDIAUTILS_API FTimespan GetLastAudioRenderedSampleTime () const
 
MEDIAUTILS_API void SetAreEventsSafeForAnyThread (bool bInAreEventsSafeForAnyThread)
 
 DECLARE_EVENT_OneParam (FMediaPlayerFacade, FOnMediaEvent, EMediaEvent) FOnMediaEvent &OnMediaEvent()
 
virtual MEDIAUTILS_API void TickFetch (FTimespan DeltaTime, FTimespan Timecode) override
 
virtual MEDIAUTILS_API void TickInput (FTimespan DeltaTime, FTimespan Timecode) override
 
virtual MEDIAUTILS_API void TickOutput (FTimespan DeltaTime, FTimespan Timecode) override
 
virtual MEDIAUTILS_API void TickTickable () override
 
- Public Member Functions inherited from IMediaClockSink
virtual void TickRender (FTimespan DeltaTime, FTimespan Timecode)
 
virtual ~IMediaClockSink ()
 
- Public Member Functions inherited from IMediaTickable
virtual ~IMediaTickable ()
 
- Public Member Functions inherited from TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
TSharedRef< FMediaPlayerFacade, Mode > AsShared ()
 
TSharedRef< FMediaPlayerFacade const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FMediaPlayerFacade, Mode > AsWeak ()
 
TWeakPtr< FMediaPlayerFacade const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Public Attributes

FName DesiredPlayerName
 
FTimespan TimeDelay
 
TOptional< FMediaPlayerOptionsActivePlayerOptions
 

Protected Member Functions

MEDIAUTILS_API bool BlockOnFetch () const
 
MEDIAUTILS_API void Flush (bool bExcludePlayer=false, bool bOnSeek=false)
 
MEDIAUTILS_API FMediaTimeStamp GetTimeStampInternal (bool bForDisplay) const
 
MEDIAUTILS_API bool GetAudioTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaAudioTrackFormat &OutFormat) const
 
MEDIAUTILS_API IMediaPlayerFactoryGetPlayerFactoryForUrl (const FString &Url, const IMediaOptions *Options) const
 
MEDIAUTILS_API bool GetVideoTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaVideoTrackFormat &OutFormat) const
 
MEDIAUTILS_API void ProcessEvent (EMediaEvent Event, bool bIsBroadcastAllowed)
 
MEDIAUTILS_API bool HaveAudioPlayback () const
 
MEDIAUTILS_API bool HaveVideoPlayback () const
 
MEDIAUTILS_API float GetUnpausedRate () const
 
MEDIAUTILS_API void ReceiveMediaEvent (EMediaEvent Event) override
 
- Protected Member Functions inherited from IMediaEventSink
virtual ~IMediaEventSink ()
 
- Protected Member Functions inherited from TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
TSharedRef< FMediaPlayerFacade, Mode > AsShared ()
 
TSharedRef< FMediaPlayerFacade const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FMediaPlayerFacade, Mode > AsWeak ()
 
TWeakPtr< FMediaPlayerFacade const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Friends

class FMediaPlayerLifecycleManagerDelegateControl
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

Facade for low-level media player objects.

The purpose of this class is to provide a simpler interface to low-level media player implementations. It implements common functionality, such as translating between time codes and play times, and manages the selection and creation of player implementations for a given media source.

Note that, unlike the low-level methods in IMediaTracks, most track and track format related methods in this class allow for INDEX_NONE to be used as track and format indices in order to indicate the 'current selection'.

Constructor & Destructor Documentation

◆ FMediaPlayerFacade()

FMediaPlayerFacade::FMediaPlayerFacade ( TWeakObjectPtr< UMediaPlayer InMediaPlayer)

Default constructor.

◆ ~FMediaPlayerFacade()

FMediaPlayerFacade::~FMediaPlayerFacade ( )
virtual

Virtual destructor.

Member Function Documentation

◆ AddAudioSampleSink()

void FMediaPlayerFacade::AddAudioSampleSink ( const TSharedRef< FMediaAudioSampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

Parameters
SampleSinkThe sink to receive audio samples.
See also
AddCaptionSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddCaptionSampleSink()

void FMediaPlayerFacade::AddCaptionSampleSink ( const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

Parameters
SampleSinkThe sink to receive caption samples.
See also
AddAudioSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddMetadataSampleSink()

void FMediaPlayerFacade::AddMetadataSampleSink ( const TSharedRef< FMediaBinarySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

Parameters
SampleSinkThe sink to receive metadata samples.
See also
AddAudioSampleSink, AddCaptionSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddSubtitleSampleSink()

void FMediaPlayerFacade::AddSubtitleSampleSink ( const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

Parameters
SampleSinkThe sink to receive subtitle samples.
See also
AddAudioSampleSink, AddCaptionSampleSink, AddMetadataSampleSink, AddVideoSampleSink

◆ AddVideoSampleSink()

void FMediaPlayerFacade::AddVideoSampleSink ( const TSharedRef< FMediaTextureSampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

Parameters
SampleSinkThe sink to receive video samples.
See also
AddAudioSampleSink, AddCaptionSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink

◆ BlockOnFetch()

bool FMediaPlayerFacade::BlockOnFetch ( ) const
protected

Whether sample fetching should block.

Returns
true if sample fetching should block, false otherwise.

◆ CanPause()

bool FMediaPlayerFacade::CanPause ( ) const

Whether playback can be paused.

Playback can be paused if the media supports pausing and if it is currently playing.

Returns
true if pausing is allowed, false otherwise.
See also
CanResume, CanScrub, CanSeek, Pause

◆ CanPlayUrl()

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

Whether the specified URL can be played by this player.

If a desired player name is set for this player, it will only check whether that particular player type can play the specified URL.

Parameters
UrlThe URL to check.
OptionsOptional media parameters.
See also
CanPlaySource, SetDesiredPlayerName

◆ CanResume()

bool FMediaPlayerFacade::CanResume ( ) const

Whether playback can be resumed.

Playback can be resumed if media is loaded and if it is not already playing.

Returns
true if resuming is allowed, false otherwise.
See also
CanPause, CanScrub, CanSeek, SetRate

◆ CanScrub()

bool FMediaPlayerFacade::CanScrub ( ) const

Whether playback can be scrubbed.

Returns
true if scrubbing is allowed, false otherwise.
See also
CanPause, CanResume, CanSeek, Seek

◆ CanSeek()

bool FMediaPlayerFacade::CanSeek ( ) const

Whether playback can jump to a position.

Returns
true if seeking is allowed, false otherwise.
See also
CanPause, CanResume, CanScrub, Seek

◆ Close()

void FMediaPlayerFacade::Close ( )

Close the currently open media, if any.

◆ DECLARE_EVENT_OneParam()

FMediaPlayerFacade::DECLARE_EVENT_OneParam ( FMediaPlayerFacade  ,
FOnMediaEvent  ,
EMediaEvent   
) &
inline

Get an event delegate that is invoked when a media event occurred.

◆ Flush()

void FMediaPlayerFacade::Flush ( bool  bExcludePlayer = false,
bool  bOnSeek = false 
)
protected

Flush all media sample sinks & player plugin.

◆ GetAudioTrackChannels()

uint32 FMediaPlayerFacade::GetAudioTrackChannels ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the number of channels in the specified audio track.

Parameters
TrackIndexIndex of the audio track.
FormatIndexIndex of the track format.
Returns
Number of channels.
See also
GetAudioTrackSampleRate, GetAudioTrackType

◆ GetAudioTrackFormat()

bool FMediaPlayerFacade::GetAudioTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaAudioTrackFormat OutFormat 
) const
protected

Get details about the specified audio track format.

Parameters
TrackIndexThe index of the audio track.
FormatIndexThe index of the track's format.
OutFormatWill contain the format details.
Returns
true on success, false otherwise.
See also
GetVideoTrackFormat

◆ GetAudioTrackSampleRate()

uint32 FMediaPlayerFacade::GetAudioTrackSampleRate ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the sample rate of the specified audio track.

Parameters
TrackIndexIndex of the audio track.
FormatIndexIndex of the track format.
Returns
Samples per second.
See also
GetAudioTrackChannels, GetAudioTrackType

◆ GetAudioTrackType()

FString FMediaPlayerFacade::GetAudioTrackType ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the type of the specified audio track format.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Audio format type string.
See also
GetAudioTrackSampleRate, GetAudioTrackSampleRate

◆ GetDisplayTimeStamp()

FMediaTimeStamp FMediaPlayerFacade::GetDisplayTimeStamp ( ) const

Get the media's current playback time stamp in a "display" version

Returns
Playback time stamp.
Note
The timestamp returned here will reflect a user-logic oriented version. (e.g. during seeks this will return the seek target rather than the last valid frame still displayed)

◆ GetDuration()

FTimespan FMediaPlayerFacade::GetDuration ( ) const

Get the media's duration.

Returns
A time span representing the duration.
See also
GetTime, Seek

◆ GetGuid()

const FGuid & FMediaPlayerFacade::GetGuid ( )

Get the player's globally unique identifier.

Returns
The Guid.
See also
SetGuid

◆ GetInfo()

FString FMediaPlayerFacade::GetInfo ( ) const

Get debug information about the player and currently opened media.

Returns
Information string.
See also
GetStats

◆ GetLastAudioRenderedSampleTime()

FTimespan FMediaPlayerFacade::GetLastAudioRenderedSampleTime ( ) const

Get time of last audio sample played

Returns
Time of last audio sample played.

◆ GetLastProcessedVideoSampleTimeRange()

TRange< FMediaTimeStamp > FMediaPlayerFacade::GetLastProcessedVideoSampleTimeRange ( ) const

Returns the last video sample time range that has been enqueued in the video sink.

◆ GetMediaInfo()

FVariant FMediaPlayerFacade::GetMediaInfo ( FName  InfoName) const

Get information about the media that is playing.

Parameters
InfoNameName of the information we want.
Returns
Requested information, or empty if not available.
See also
UMediaPlayer::GetMediaInfo.

◆ GetMediaMetadata()

TSharedPtr< TMap< FString, TArray< TUniquePtr< IMediaMetadataItem > > >, ESPMode::ThreadSafe > FMediaPlayerFacade::GetMediaMetadata ( ) const

Get meta data contained in the current stream

Returns
Map with arrays of IMediaMetaDataItem entries describing any metadata found in the current stream
Note
Listen to EMediaEvent::MetadataChanged to catch updates to this data

◆ GetMediaName()

FText FMediaPlayerFacade::GetMediaName ( ) const

Get the human readable name of the currently loaded media source.

Returns
Media source name, or empty text if no media is opened
See also
GetPlayerName, GetUrl

◆ GetNumTrackFormats()

int32 FMediaPlayerFacade::GetNumTrackFormats ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the number of formats of the specified track.

Parameters
TrackTypeThe type of media tracks.
TrackIndexThe index of the track.
Returns
Number of formats.
See also
GetNumTracks, GetSelectedTrack, SelectTrack

◆ GetNumTracks()

int32 FMediaPlayerFacade::GetNumTracks ( EMediaTrackType  TrackType) const

Get the number of tracks of the given type.

Parameters
TrackTypeThe type of media tracks.
Returns
Number of tracks.
See also
GetSelectedTrack, SelectTrack

◆ GetPlaybackTimeRange()

TRange< FTimespan > FMediaPlayerFacade::GetPlaybackTimeRange ( EMediaTimeRangeType  InRangeToGet) const

Returns the current playback range of the media. If playing back a range is not supported, the range returned will be equal to [ 0, GetDuration() ). The media may have an implicit default range provided by the container format or other means without having called SetPlaybackTimeRange(). The media may have internal time values not starting at 0, which are conveyed by the range. Since the range may be only a portion of the media, the duration of the returned range may be less than the media overall duration returned by GetDuration(). For live video streams the range may change dynamically as new content becomes available and old content falls off the timeline.

Parameters
InRangeToGetThe type of range to get. Absolute returns the media's smallest and largest timeline values. Unless continuously changing in a Live stream this is usually the same as [ 0, GetDuration() ]. The base time does not have to be zero though. Current returns the currently set range, which is a subset of the absolute range.
Returns
The playback range as queried for or an empty range if there is no open player.
See also
SupportsPlaybackTimeRange, SetPlaybackTimeRange, GetDuration

◆ GetPlayer()

TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > FMediaPlayerFacade::GetPlayer ( ) const
inline

Get the low-level player associated with this object.

Returns
The player, or nullptr if no player was created.

◆ GetPlayerFactoryForUrl()

IMediaPlayerFactory * FMediaPlayerFacade::GetPlayerFactoryForUrl ( const FString &  Url,
const IMediaOptions Options 
) const
protected

Get a player that can play the specified media URL.

Parameters
UrlThe URL to play.
OptionsThe media options for the URL.
Returns
The player if found, or nullptr otherwise.

◆ GetPlayerName()

FName FMediaPlayerFacade::GetPlayerName ( ) const

Get the name of the current native media player.

Returns
Player name, or NAME_None if not available.
See also
GetMediaName

◆ GetRate()

float FMediaPlayerFacade::GetRate ( ) const

Get the media's current playback rate.

Returns
The playback rate.
See also
SetRate, SupportsRate

◆ GetSeekTarget()

FMediaTimeStamp FMediaPlayerFacade::GetSeekTarget ( ) const

If valid, returns the current seek request.

See also
Seek, IsSeeking

◆ GetSelectedTrack()

int32 FMediaPlayerFacade::GetSelectedTrack ( EMediaTrackType  TrackType) const

Get the index of the currently selected track of the given type.

Parameters
TrackTypeThe type of track to get.
Returns
The index of the selected track, or INDEX_NONE if no track is active.
See also
GetNumTracks, SelectTrack

◆ GetStats()

FString FMediaPlayerFacade::GetStats ( ) const

Get playback statistics information.

Returns
Information string.
See also
GetInfo

◆ GetSupportedRates()

TRangeSet< float > FMediaPlayerFacade::GetSupportedRates ( bool  Unthinned = true) const

Get the supported playback rates.

Parameters
UnthinnedWhether the rates are for unthinned playback (default = true).
Returns
The ranges of supported rates.
See also
SetRate, SupportsRate

◆ GetTime()

FTimespan FMediaPlayerFacade::GetTime ( ) const

Get the media's current playback time.

Returns
Playback time.
See also
GetDuration, Seek

◆ GetTimeStamp()

FMediaTimeStamp FMediaPlayerFacade::GetTimeStamp ( ) const

Get the media's current playback time stamp.

Returns
Playback time stamp.

◆ GetTimeStampInternal()

FMediaTimeStamp FMediaPlayerFacade::GetTimeStampInternal ( bool  bForDisplay) const
protected

Internal function to retrieve the current timestamp

◆ GetTrackDisplayName()

FText FMediaPlayerFacade::GetTrackDisplayName ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the human readable name of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track.
Returns
Display name.
See also
GetNumTracks, GetTrackLanguage

◆ GetTrackFormat()

int32 FMediaPlayerFacade::GetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the index of the active format of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track.
Returns
The index of the selected format.
See also
GetNumTrackFormats, GetSelectedTrack, SetTrackFormat

◆ GetTrackLanguage()

FString FMediaPlayerFacade::GetTrackLanguage ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the language tag of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track.
Returns
Language tag, i.e. "en-US" for English, or "und" for undefined.
See also
GetNumTracks, GetTrackDisplayName

◆ GetUnpausedRate()

float FMediaPlayerFacade::GetUnpausedRate ( ) const
protected

◆ GetUrl()

const FString & FMediaPlayerFacade::GetUrl ( ) const
inline

Get the URL of the currently loaded media, if any.

Returns
Media URL, or empty string if no media was loaded.

◆ GetVideoTimecode()

TOptional< FTimecode > FMediaPlayerFacade::GetVideoTimecode ( ) const

Get the timecode from the video track, if one is available. If available, the returned value will be the timecode of the sample most recently sent into the video sink.

Returns
Most recently delivered video timecode from the video track.
Note
Even if timecode is available, the value returned reflects the timecode that most recently delivered to the video sink. During a seek operation the timecode will be unset.

◆ GetVideoTrackAspectRatio()

float FMediaPlayerFacade::GetVideoTrackAspectRatio ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the aspect ratio of the specified video track.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Aspect ratio.
See also
GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackDimensions()

FIntPoint FMediaPlayerFacade::GetVideoTrackDimensions ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the width and height of the specified video track.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Video dimensions.
See also
GetVideoTrackAspectRatio, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackFormat()

bool FMediaPlayerFacade::GetVideoTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaVideoTrackFormat OutFormat 
) const
protected

Get details about the specified audio track format.

Parameters
TrackIndexThe index of the audio track.
FormatIndexThe index of the track's format.
OutFormatWill contain the format details.
Returns
true on success, false otherwise.
See also
GetVideoTrackFormat

◆ GetVideoTrackFrameRate()

float FMediaPlayerFacade::GetVideoTrackFrameRate ( int32  TrackIndex,
int32  FormatIndex 
) const

Get frame rate of the specified video track.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Video frame rate.
See also
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackFrameRates()

TRange< float > FMediaPlayerFacade::GetVideoTrackFrameRates ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the supported range of frame rates of the specified video track.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Frame rate range (in frames per second).
See also
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackType

◆ GetVideoTrackType()

FString FMediaPlayerFacade::GetVideoTrackType ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the type of the specified video track format.

Parameters
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
Returns
Video format type string.
See also
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates

◆ GetViewField()

bool FMediaPlayerFacade::GetViewField ( float OutHorizontal,
float OutVertical 
) const

Get the field of view.

Parameters
OutHorizontalWill contain the horizontal field of view.
OutVerticalWill contain the vertical field of view.
Returns
true on success, false if feature is not available or if field of view has never been set.
See also
GetViewOrientation, SetViewField

◆ GetViewOrientation()

bool FMediaPlayerFacade::GetViewOrientation ( FQuat OutOrientation) const

Get the view's orientation.

Parameters
OutOrientationWill contain the view orientation.
Returns
true on success, false if feature is not available or if orientation has never been set.
See also
GetViewField, SetViewOrientation

◆ HasError()

bool FMediaPlayerFacade::HasError ( ) const

Check whether the player is in an error state.

See also
IsReady

◆ HaveAudioPlayback()

bool FMediaPlayerFacade::HaveAudioPlayback ( ) const
protected

◆ HaveVideoPlayback()

bool FMediaPlayerFacade::HaveVideoPlayback ( ) const
protected

◆ IsBuffering()

bool FMediaPlayerFacade::IsBuffering ( ) const

Whether the player is currently buffering data.

Returns
true if buffering, false otherwise.
See also
GetState, IsConnecting, IsLooping

◆ IsClosed()

bool FMediaPlayerFacade::IsClosed ( ) const

Whether media is currently closed.

Returns
true if media is closed, false otherwise.

◆ IsConnecting()

bool FMediaPlayerFacade::IsConnecting ( ) const

Whether the player is currently connecting to a media source.

Returns
true if connecting, false otherwise.
See also
GetState, IsBuffering, IsLooping

◆ IsLooping()

bool FMediaPlayerFacade::IsLooping ( ) const

Whether playback is looping.

Returns
true if looping, false otherwise.
See also
GetState, IsBuffering, IsConnecting, SetLooping

◆ IsPaused()

bool FMediaPlayerFacade::IsPaused ( ) const

Whether playback is currently paused.

Returns
true if playback is paused, false otherwise.
See also
CanPause, IsPlaying, IsReady, Pause

◆ IsPlaying()

bool FMediaPlayerFacade::IsPlaying ( ) const

Whether playback is in progress.

Returns
true if playback has started, false otherwise.
See also
CanPlay, IsPaused, IsReady, Play

◆ IsPreparing()

bool FMediaPlayerFacade::IsPreparing ( ) const

Whether the media is currently opening or buffering.

Returns
true if playback is being prepared, false otherwise.
See also
CanPlay, IsPaused, IsReady, Play

◆ IsReady()

bool FMediaPlayerFacade::IsReady ( ) const

Whether media is ready for playback.

A player is ready for playback if it has a media source opened that finished preparing and is not in an error state.

Returns
true if media is ready, false otherwise.
See also
HasError, IsPaused, IsPlaying, Stop

◆ IsSeeking()

bool FMediaPlayerFacade::IsSeeking ( ) const

A seek has been requested, waiting to receive samples.

See also
Seek

◆ Open()

bool FMediaPlayerFacade::Open ( const FString &  Url,
const IMediaOptions Options,
const FMediaPlayerOptions PlayerOptions = nullptr 
)

Open a media source from a URL with optional parameters.

Parameters
UrlThe URL of the media to open (file name or web address).
OptionsOptional media parameters.
PlayerOptionsOptional player parameters.
Returns
true if the media is being opened, false otherwise.

◆ ProcessEvent()

void FMediaPlayerFacade::ProcessEvent ( EMediaEvent  Event,
bool  bIsBroadcastAllowed 
)
protected

Process the given media event.

Parameters
EventThe event to process.
bIsBroadcastAllowedIf true then we can broadcast events, if false then they will sent when possible.

◆ QueryCacheState()

void FMediaPlayerFacade::QueryCacheState ( EMediaTrackType  TrackType,
EMediaCacheState  State,
TRangeSet< FTimespan > &  OutTimeRanges 
) const

Query the time ranges of cached media samples for the specified caching state.

Parameters
StateThe sample state we're interested in.
OutTimeRangesWill contain the set of matching sample time ranges.

◆ ReceiveMediaEvent()

void FMediaPlayerFacade::ReceiveMediaEvent ( EMediaEvent  Event)
overrideprotectedvirtual

Receive the given media event.

Parameters
EventThe event to receive.
Note
Implementors must be thread-safe as this method may be called from arbitrary worker threads.

Implements IMediaEventSink.

◆ Seek()

bool FMediaPlayerFacade::Seek ( const FTimespan Time)

Seeks to the specified playback time.

Parameters
TimeThe playback time to set.
Returns
true on success, false otherwise.
See also
GetTime, Rewind

◆ SelectTrack()

bool FMediaPlayerFacade::SelectTrack ( EMediaTrackType  TrackType,
int32  TrackIndex 
)

Select the active track of the given type.

The selected track will use its currently active format. Active formats will be remembered on a per track basis. The first available format is active by default. To switch the track format, use SetTrackFormat instead.

Parameters
TrackTypeThe type of track to select.
TrackIndexThe index of the track to select, or INDEX_NONE to deselect.
Returns
true if the track was selected, false otherwise.
See also
GetNumTracks, GetSelectedTrack, SetTrackFormat

◆ SetAreEventsSafeForAnyThread()

void FMediaPlayerFacade::SetAreEventsSafeForAnyThread ( bool  bInAreEventsSafeForAnyThread)

Sets whether the player can broadcast events when running on a thread other than the game thread.

Parameters
bInAreEventsSafeForAnyThreadIf true then allow broadcast when not on the game thread.

◆ SetBlockOnTime()

void FMediaPlayerFacade::SetBlockOnTime ( const FTimespan Time)

Set the time on which to block.

If set, this player will block in TickFetch until the video sample for the specified time are actually available.

Parameters
TimeThe time to block on, or FTimespan::MinValue to disable.
See also
TickFetch
Note
Deprecated: Use SetBlockOnTimeRange instead

◆ SetBlockOnTimeRange()

void FMediaPlayerFacade::SetBlockOnTimeRange ( const TRange< FTimespan > &  TimeRange)

Set the time range on which to block.

If set, this player will block in TickFetch until the video sample for the specified time are actually available.

Parameters
TimeRangeThe time range to block on, use empty range to disable

◆ SetCacheWindow()

void FMediaPlayerFacade::SetCacheWindow ( FTimespan  Ahead,
FTimespan  Behind 
)

Set sample caching options.

Parameters
AheadDuration of samples to cache ahead of the play head.
BehindDuration of samples to cache behind the play head.

◆ SetGuid()

void FMediaPlayerFacade::SetGuid ( FGuid Guid)

Set the player's globally unique identifier.

Parameters
GuidThe GUID to set.
See also
GetGuid

◆ SetLastAudioRenderedSampleTime()

void FMediaPlayerFacade::SetLastAudioRenderedSampleTime ( FTimespan  SampleTime)

Record last audio sample played to track audio sync (for automated tests)

Parameters
SampleTimeTime of media sample currently being played
Returns
true if playback is being prepared, false otherwise.

◆ SetLooping()

bool FMediaPlayerFacade::SetLooping ( bool  Looping)

Enables or disables playback looping.

Parameters
LoopingWhether playback should be looped.
Returns
true on success, false otherwise.
See also
IsLooping

◆ SetMediaOptions()

void FMediaPlayerFacade::SetMediaOptions ( const IMediaOptions Options)

Changes media ooptions on the player.

◆ SetNativeVolume()

bool FMediaPlayerFacade::SetNativeVolume ( float  Volume)

Changes the media's native volume.

Parameters
RateThe volume to set.
Returns
true on success, false otherwise.
See also
NativeAudioOut

◆ SetNextSeek()

void FMediaPlayerFacade::SetNextSeek ( const FTimespan InTime)

Set seek to be done after current seek is completed.

Remarks
This value is reset if Seek is called directly.

◆ SetPlaybackTimeRange()

bool FMediaPlayerFacade::SetPlaybackTimeRange ( const TRange< FTimespan > &  InTimeRange)

Sets a new media playback range. Has an effect only if SupportsPlaybackTimeRange() returns true and the media supports it. A live stream cannot be constrained to a range. The range will be clamped if necessary to be within the media's absolute time range. Changing the time range may trigger an implicit Seek() depending on where the current playback position is located with regard to the new range. Unless prevented by the media a playback range can be cleared by passing an empty range.

Parameters
InTimeRangeThe new playback range to set.
Returns
true if successful, false otherwise.
See also
SupportsPlaybackTimeRange, GetPlaybackTimeRange

◆ SetRate()

bool FMediaPlayerFacade::SetRate ( float  Rate)

Changes the media's playback rate.

Parameters
RateThe playback rate to set.
Returns
true on success, false otherwise.
See also
GetRate, SupportsRate

◆ SetTrackFormat()

bool FMediaPlayerFacade::SetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex,
int32  FormatIndex 
)

Set the format on the specified track.

Selecting the format will not switch to the specified track. To switch tracks, use SelectTrack instead. If the track is already selected, the format change will be applied immediately.

Parameters
TrackTypeThe type of track to update.
TrackIndexThe index of the track to update.
FormatIndexThe index of the format to select (must be valid).
Returns
true if the track was selected, false otherwise.
See also
GetNumTrackFormats, GetNumTracks, GetTrackFormat, SelectTrack

◆ SetVideoTrackFrameRate()

bool FMediaPlayerFacade::SetVideoTrackFrameRate ( int32  TrackIndex,
int32  FormatIndex,
float  FrameRate 
)

Set the frame rate of the specified video track.

Parameters
TrackIndexThe index of the track, or INDEX_NONE for the selected one.
FormatIndexIndex of the track format, or INDEX_NONE for the selected one.
FrameRateThe frame rate to set (must be in range of format's supported frame rates).
Returns
true on success, false otherwise.
See also
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ SetViewField()

bool FMediaPlayerFacade::SetViewField ( float  Horizontal,
float  Vertical,
bool  Absolute 
)

Set the field of view.

Parameters
HorizontalHorizontal field of view (in Euler degrees).
VerticalVertical field of view (in Euler degrees).
Whetherthe field of view change should be absolute (true) or relative (false).
Returns
true on success, false otherwise.
See also
GetViewField, SetViewOrientation

◆ SetViewOrientation()

bool FMediaPlayerFacade::SetViewOrientation ( const FQuat Orientation,
bool  Absolute 
)

Set the view's orientation.

Parameters
OrientationQuaternion representing the orientation.
Whetherthe orientation change should be absolute (true) or relative (false).
Returns
true on success, false otherwise.
See also
GetViewOrientation, SetViewField

◆ SupportsPlaybackTimeRange()

bool FMediaPlayerFacade::SupportsPlaybackTimeRange ( ) const

Check whether the player supports playing back of range within the media.

Returns
true if playing back a range is supported, false otherwise.
See also
GetPlaybackTimeRange, SetPlaybackTimeRange

◆ SupportsRate()

bool FMediaPlayerFacade::SupportsRate ( float  Rate,
bool  Unthinned 
) const

Whether the specified playback rate is supported.

Parameters
RateThe playback rate to check.
UnthinnedWhether no frames should be dropped at the given rate.
See also
CanScrub, CanSeek

◆ TickFetch()

void FMediaPlayerFacade::TickFetch ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to handle updates after the Engine ticked.

Parameters
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
See also
TickInput, TickOutput, TickRender

Reimplemented from IMediaClockSink.

◆ TickInput()

void FMediaPlayerFacade::TickInput ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to handle input before the Engine is ticked.

Parameters
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
See also
TickFetch, TickOutput, TickRender

Reimplemented from IMediaClockSink.

◆ TickOutput()

void FMediaPlayerFacade::TickOutput ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to output the rendered frame.

Parameters
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
See also
TickFetch, TickInput, TickRender

Reimplemented from IMediaClockSink.

◆ TickTickable()

void FMediaPlayerFacade::TickTickable ( )
overridevirtual

Tick the object.

Implements IMediaTickable.

Friends And Related Symbol Documentation

◆ FMediaPlayerLifecycleManagerDelegateControl

Member Data Documentation

◆ ActivePlayerOptions

TOptional<FMediaPlayerOptions> FMediaPlayerFacade::ActivePlayerOptions

Active media player options.

◆ DesiredPlayerName

FName FMediaPlayerFacade::DesiredPlayerName

Name of the desired native player, if any.

◆ TimeDelay

FTimespan FMediaPlayerFacade::TimeDelay

Extra time to reduce from current player's time.


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