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

#include <IMediaControls.h>

Public Member Functions

virtual bool CanControl (EMediaControl Control) const =0
 
virtual FTimespan GetDuration () const =0
 
virtual float GetRate () const =0
 
virtual EMediaState GetState () const =0
 
virtual EMediaStatus GetStatus () const =0
 
virtual TRangeSet< floatGetSupportedRates (EMediaRateThinning Thinning) const =0
 
virtual FTimespan GetTime () const =0
 
virtual bool IsLooping () const =0
 
virtual bool Seek (const FTimespan &Time)=0
 
virtual bool SetLooping (bool Looping)=0
 
virtual bool SetRate (float Rate)=0
 
virtual void SetBlockingPlaybackHint (bool bFacadeWillUseBlockingPlayback)
 
virtual bool Seek (const FTimespan &InNewTime, const FMediaSeekParams &InAdditionalParams)
 
bool Pause ()
 
bool Play ()
 
bool Seek (const FTimespan &TimeOffset, EMediaSeekDirection Direction)
 
virtual TRange< FTimespanGetPlaybackTimeRange (EMediaTimeRangeType InRangeToGet) const
 
virtual bool SetPlaybackTimeRange (const TRange< FTimespan > &InTimeRange)
 
virtual ~IMediaControls ()
 

Detailed Description

Interface for controlling media playback.

See also
IMediaCache, IMediaPlayer, IMediaSamples, IMediaTracks, IMediaView

Constructor & Destructor Documentation

◆ ~IMediaControls()

virtual IMediaControls::~IMediaControls ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ CanControl()

virtual bool IMediaControls::CanControl ( EMediaControl  Control) const
pure virtual

Whether the specified control is currently available.

Returns
true if the control is available, false otherwise.

◆ GetDuration()

virtual FTimespan IMediaControls::GetDuration ( ) const
pure virtual

Get the media's duration.

Returns
A time span representing the duration.
See also
GetTime

◆ GetPlaybackTimeRange()

virtual TRange< FTimespan > IMediaControls::GetPlaybackTimeRange ( EMediaTimeRangeType  InRangeToGet) const
inlinevirtual

◆ GetRate()

virtual float IMediaControls::GetRate ( ) const
pure virtual

Get the nominal playback rate, i.e. 1.0 for real time.

Returns
Playback rate.
See also
Pause, Play, SetRate

◆ GetState()

virtual EMediaState IMediaControls::GetState ( ) const
pure virtual

Get the state of the media.

Returns
Media state.
See also
IsLooping

◆ GetStatus()

virtual EMediaStatus IMediaControls::GetStatus ( ) const
pure virtual

Get media player status flags.

Returns
Status flags.

◆ GetSupportedRates()

virtual TRangeSet< float > IMediaControls::GetSupportedRates ( EMediaRateThinning  Thinning) const
pure virtual

Get the supported playback rates.

Parameters
ThinningThe desired rate thinning mode.
Returns
The ranges of supported rates.
See also
SetRate, SupportsRate

◆ GetTime()

virtual FTimespan IMediaControls::GetTime ( ) const
pure virtual

Get the player's current playback time.

Returns
Playback time.
See also
Seek

◆ IsLooping()

virtual bool IMediaControls::IsLooping ( ) const
pure virtual

Check whether playback is currently looping.

Returns
true if playback is looping, false otherwise.
See also
GetState, SetLooping

◆ Pause()

bool IMediaControls::Pause ( )
inline

Pause media playback.

This is the same as setting the playback rate to 0.0.

Returns
true if the media is being paused, false otherwise.
See also
Play, Stop

◆ Play()

bool IMediaControls::Play ( )
inline

Start media playback at the default rate of 1.0.

This is the same as setting the playback rate to 1.0.

Returns
true if playback is starting, false otherwise.
See also
Pause, Stop

◆ Seek() [1/3]

virtual bool IMediaControls::Seek ( const FTimespan InNewTime,
const FMediaSeekParams InAdditionalParams 
)
inlinevirtual

Same as Seek(), but with additional options. This default implementation just calls Seek() and ignores options.

◆ Seek() [2/3]

virtual bool IMediaControls::Seek ( const FTimespan Time)
pure virtual

Change the media's playback time.

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

◆ Seek() [3/3]

bool IMediaControls::Seek ( const FTimespan TimeOffset,
EMediaSeekDirection  Direction 
)
inline

Change the playback time of the media by a relative offset in the given direction.

Parameters
TimeOffsetThe offset to apply to the time.
DirectionThe direction to seek in.
Returns
true on success, false otherwise.
See also
GetDuration, GetTime

◆ SetBlockingPlaybackHint()

virtual void IMediaControls::SetBlockingPlaybackHint ( bool  bFacadeWillUseBlockingPlayback)
inlinevirtual

Hint for player indicating that blocked playback mode will be used / not used

Parameters
bFacadeWillUseBlockingPlaybackTrue if blocked playback will be used, false otherwiese
Note
Implement as needed by the player.

◆ SetLooping()

virtual bool IMediaControls::SetLooping ( bool  Looping)
pure virtual

Set whether playback should be looping.

Parameters
LoopingEnables or disables looping.
See also
IsLooping

◆ SetPlaybackTimeRange()

virtual bool IMediaControls::SetPlaybackTimeRange ( const TRange< FTimespan > &  InTimeRange)
inlinevirtual

◆ SetRate()

virtual bool IMediaControls::SetRate ( float  Rate)
pure virtual

Set the current playback rate.

A playback rate of 1.0 will play the media normally at real-time. A rate of 0.0 corresponds to pausing playback. A negative rate, if supported, plays the media in reverse, and a rate larger than 1.0 fast forwards playback.

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

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