unreal.MediaPlayer

class unreal.MediaPlayer(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

Implements a media player asset that can play movies and other media sources.

C++ Source:

  • Module: MediaAssets

  • File: MediaPlayer.h

Editor Properties: (see get_editor_property/set_editor_property)

  • affected_by_pie_handling (bool): [Read-Write] Affected by PIEHandling: Whether this player should stop when entering or exiting PIE.

  • cache_ahead (Timespan): [Read-Write] Cache Ahead: Duration of samples to cache ahead of the play head. see: CacheBehind, CacheBehindGame

  • cache_behind (Timespan): [Read-Write] Cache Behind: Duration of samples to cache behind the play head (when not running as game). see: CacheAhead, CacheBehindGame

  • cache_behind_game (Timespan): [Read-Write] Cache Behind Game: Duration of samples to cache behind the play head (when running as game). see: CacheAhead, CacheBehind

  • horizontal_field_of_view (float): [Read-Write] Horizontal Field Of View: The initial horizontal field of view (in Euler degrees; default = 90).

    This setting is used only for 360 videos. It determines the portion of the video that is visible at a time. To modify the field of view at runtime in Blueprints, use the SetHorizontalFieldOfView function. see: GetHorizontalFieldOfView, SetHorizontalFieldOfView, VerticalFieldOfView, ViewRotation

  • loop (bool): [Read-Write] Loop: Whether the player should loop when media playback reaches the end.

    Use the SetLooping function to change this value at runtime. see: IsLooping, SetLooping

  • native_audio_out (bool): [Read-Write] Native Audio Out: Output any audio via the operating system’s sound mixer instead of a Sound Wave asset.

    If enabled, the assigned Sound Wave asset will be ignored. The SetNativeVolume function can then be used to change the audio output volume at runtime. Note that not all media player plug-ins may support native audio output on all platforms. see: SetNativeVolume

  • on_end_reached (OnMediaPlayerMediaEvent): [Read-Write] On End Reached: A delegate that is invoked when playback has reached the end of the media.

  • on_media_closed (OnMediaPlayerMediaEvent): [Read-Write] On Media Closed: A delegate that is invoked when a media source has been closed.

  • on_media_open_failed (OnMediaPlayerMediaOpenFailed): [Read-Write] On Media Open Failed: A delegate that is invoked when a media source has failed to open.

    This delegate is only executed if OpenSource / OpenUrl returned true and the media failed to open asynchronously later. It is not executed if OpenSource / OpenUrl returned false, indicating an immediate failure. see: OnMediaOpened

  • on_media_opened (OnMediaPlayerMediaOpened): [Read-Write] On Media Opened: A delegate that is invoked when a media source has been opened.

    Depending on whether the underlying player implementation opens the media synchronously or asynchronously, this event may be executed before or after the call to OpenSource / OpenUrl returns. see: OnMediaOpenFailed, OnTracksChanged

  • on_playback_resumed (OnMediaPlayerMediaEvent): [Read-Write] On Playback Resumed: A delegate that is invoked when media playback has been resumed. see: OnPlaybackSuspended

  • on_playback_suspended (OnMediaPlayerMediaEvent): [Read-Write] On Playback Suspended: A delegate that is invoked when media playback has been suspended. see: OnPlaybackResumed

  • on_seek_completed (OnMediaPlayerMediaEvent): [Read-Write] On Seek Completed: A delegate that is invoked when a seek operation completed successfully.

    Depending on whether the underlying player implementation performs seeks synchronously or asynchronously, this event may be executed before or after the call to Seek returns.

  • on_tracks_changed (OnMediaPlayerMediaEvent): [Read-Write] On Tracks Changed: A delegate that is invoked when the media track collection changed. see: OnMediaOpened

  • play_on_open (bool): [Read-Write] Play on Open: Automatically start playback after media opened successfully.

    If disabled, listen to the OnMediaOpened Blueprint event to detect when the media finished opening, and then start playback using the Play function. see: OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Play

  • playlist (MediaPlaylist): [Read-Write] Playlist: The play list to use, if any.

    Use the OpenPlaylist or OpenPlaylistIndex function to change this value at runtime. see: OpenPlaylist, OpenPlaylistIndex

  • playlist_index (int32): [Read-Write] Playlist Index: The current index of the source in the play list being played.

    Use the Previous and Next methods to change this value at runtime. see: Next, Previous

  • shuffle (bool): [Read-Write] Shuffle: Whether playback should shuffle media sources in the play list. see: OpenPlaylist, OpenPlaylistIndex

  • time_delay (Timespan): [Read-Write] Time Delay: Delay of the player’s time. see: SetTimeDelay, GetTimeDelay

  • vertical_field_of_view (float): [Read-Write] Vertical Field Of View: The initial vertical field of view (in Euler degrees; default = 60).

    This setting is used only for 360 videos. It determines the portion of the video that is visible at a time. To modify the field of view at runtime in Blueprints, use the SetHorizontalFieldOfView function.

    Please note that some 360 video players may be able to change only the horizontal field of view, and this setting may be ignored. see: GetVerticalFieldOfView, SetVerticalFieldOfView, HorizontalFieldOfView, ViewRotation

  • view_rotation (Rotator): [Read-Write] View Rotation: The initial view rotation.

    This setting is used only for 360 videos. It determines the rotation of the video’s view. To modify the view orientation at runtime in Blueprints, use the GetViewRotation and SetViewRotation functions.

    Please note that not all players may support video view rotations. see: GetViewRotation, SetViewRotation, HorizontalFieldOfView, VerticalFieldOfView

property affected_by_pie_handling: bool

[Read-Write] Affected by PIEHandling: Whether this player should stop when entering or exiting PIE.

Type:

(bool)

property cache_ahead: Timespan

[Read-Write] Cache Ahead: Duration of samples to cache ahead of the play head. see: CacheBehind, CacheBehindGame

Type:

(Timespan)

property cache_behind: Timespan

[Read-Write] Cache Behind: Duration of samples to cache behind the play head (when not running as game). see: CacheAhead, CacheBehindGame

Type:

(Timespan)

property cache_behind_game: Timespan

[Read-Write] Cache Behind Game: Duration of samples to cache behind the play head (when running as game). see: CacheAhead, CacheBehind

Type:

(Timespan)

can_pause() bool

Check whether media playback can be paused right now.

Playback can be paused if the media supports pausing and if it is currently playing. see: CanPlay, Pause

Returns:

true if pausing playback can be paused, false otherwise.

Return type:

bool

can_play_source(media_source) bool

Check whether the specified media source 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 source. see: CanPlayUrl, SetDesiredPlayerName

Parameters:

media_source (MediaSource) – The media source to check.

Returns:

true if the media source can be opened, false otherwise.

Return type:

bool

can_play_url(url) bool

Check 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. see: CanPlaySource, SetDesiredPlayerName

Parameters:

url (str) – The URL to check.

Return type:

bool

close() None

Close the currently open media, if any. see: OnMediaClosed, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Pause, Play

get_audio_track_channels(track_index, format_index) int32

Get the number of channels in the specified audio track. see: GetAudioTrackSampleRate, GetAudioTrackType

Parameters:
  • track_index (int32) – Index of the audio track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Number of channels.

Return type:

int32

get_audio_track_sample_rate(track_index, format_index) int32

Get the sample rate of the specified audio track. see: GetAudioTrackChannels, GetAudioTrackType

Parameters:
  • track_index (int32) – Index of the audio track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Samples per second.

Return type:

int32

get_audio_track_type(track_index, format_index) str

Get the type of the specified audio track format. see: GetAudioTrackSampleRate, GetAudioTrackSampleRate

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Audio format type string.

Return type:

str

get_desired_player_name() Name

Get the name of the current desired native player. see: SetDesiredPlayerName

Returns:

The name of the desired player, or NAME_None if not set.

Return type:

Name

get_duration() Timespan

Get the media’s duration. see: GetTime, Seek

Returns:

A time span representing the duration.

Return type:

Timespan

get_horizontal_field_of_view() float

Get the current horizontal field of view (only for 360 videos). see: GetVerticalFieldOfView, GetViewRotation, SetHorizontalFieldOfView

Returns:

Horizontal field of view (in Euler degrees).

Return type:

float

get_media_name() Text

Get the human readable name of the currently loaded media source. see: GetPlayerName, GetUrl

Returns:

Media source name, or empty text if no media is opened

Return type:

Text

get_num_track_formats(track_type, track_index) int32

Get the number of formats of the specified track. see: GetNumTracks, GetSelectedTrack, SelectTrack

Parameters:
  • track_type (MediaPlayerTrack) – The type of media tracks.

  • track_index (int32) – The index of the track.

Returns:

Number of formats.

Return type:

int32

get_num_tracks(track_type) int32

Get the number of tracks of the given type. see: GetNumTrackFormats, GetSelectedTrack, SelectTrack

Parameters:

track_type (MediaPlayerTrack) – The type of media tracks.

Returns:

Number of tracks.

Return type:

int32

get_player_name() Name

Get the name of the current native media player. see: GetMediaName

Returns:

Player name, or NAME_None if not available.

Return type:

Name

get_playlist() MediaPlaylist

Get the current play list.

Media players always have a valid play list. In C++ code you can use the GetPlaylistRef to get a reference instead of a pointer to it. see: GetPlaylistIndex, GetPlaylistRef

Returns:

The play list.

Return type:

MediaPlaylist

get_playlist_index() int32

Get the current play list index. see: GetPlaylist

Returns:

Play list index.

Return type:

int32

get_rate() float

Get the media’s current playback rate. see: SetRate, SupportsRate

Returns:

The playback rate.

Return type:

float

get_selected_track(track_type) int32

Get the index of the currently selected track of the given type. see: GetNumTracks, GetTrackFormat, SelectTrack

Parameters:

track_type (MediaPlayerTrack) – The type of track to get.

Returns:

The index of the selected track, or INDEX_NONE if no track is active.

Return type:

int32

get_supported_rates(unthinned) Array[FloatRange]

Get the supported playback rates. see: SetRate, SupportsRate

Parameters:

unthinned (bool) – Whether the rates are for unthinned playback.

Returns:

out_rates (Array[FloatRange]):

Return type:

Array[FloatRange]

get_time() Timespan

Get the media’s current playback time. see: GetDuration, Seek

Returns:

Playback time.

Return type:

Timespan

get_time_delay() Timespan

Delay of the player’s time. see: SetTimeDelay

Returns:

Delay added to the player’s time used to manually sync multiple sources.

Return type:

Timespan

get_time_stamp() MediaTimeStampInfo

Get the media’s current playback timestamp. see: GetDuration, Seek

Returns:

Playback timestamp.

Return type:

MediaTimeStampInfo

get_track_display_name(track_type, track_index) Text

Get the human readable name of the specified track. see: GetNumTracks, GetTrackLanguage

Parameters:
  • track_type (MediaPlayerTrack) – The type of track.

  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

Returns:

Display name.

Return type:

Text

get_track_format(track_type, track_index) int32

Get the index of the active format of the specified track type. see: GetNumTrackFormats, GetSelectedTrack, SetTrackFormat

Parameters:
  • track_type (MediaPlayerTrack) – The type of track.

  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

Returns:

The index of the selected format.

Return type:

int32

get_track_language(track_type, track_index) str

Get the language tag of the specified track. see: GetNumTracks, GetTrackDisplayName

Parameters:
  • track_type (MediaPlayerTrack) – The type of track.

  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

Returns:

Language tag, i.e. “en-US” for English, or “und” for undefined.

Return type:

str

get_url() str

Get the URL of the currently loaded media, if any. see: OpenUrl

Returns:

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

Return type:

str

get_vertical_field_of_view() float

Get the current vertical field of view (only for 360 videos). see: GetHorizontalFieldOfView, GetViewRotation, SetVerticalFieldOfView

Returns:

Vertical field of view (in Euler degrees), or 0.0 if not available.

Return type:

float

get_video_track_aspect_ratio(track_index, format_index) float

Get the aspect ratio of the specified video track. see: GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

Parameters:
  • track_index (int32) – Index of the video track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Aspect ratio.

Return type:

float

get_video_track_dimensions(track_index, format_index) IntPoint

Get the current dimensions of the specified video track. see: GetVideoTrackAspectRatio, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Video dimensions (in pixels).

Return type:

IntPoint

get_video_track_frame_rate(track_index, format_index) float

Get the frame rate of the specified video track. see: GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRates, GetVideoTrackType, SetVideoTrackFrameRate

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Frame rate (in frames per second).

Return type:

float

get_video_track_frame_rates(track_index, format_index) FloatRange

Get the supported range of frame rates of the specified video track. see: GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackType

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Frame rate range (in frames per second).

Return type:

FloatRange

get_video_track_type(track_index, format_index) str

Get the type of the specified video track format. see: GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

Returns:

Video format type string.

Return type:

str

get_view_rotation() Rotator

Get the current view rotation (only for 360 videos). see: GetHorizontalFieldOfView, GetVerticalFieldOfView, SetViewRotation

Returns:

View rotation, or zero rotator if not available.

Return type:

Rotator

has_error() bool

Check whether the player is in an error state.

When the player is in an error state, no further operations are possible. The current media must be closed, and a new media source must be opened before the player can be used again. Errors are usually caused by faulty media files or interrupted network connections. see: IsReady

Return type:

bool

is_buffering() bool

Check whether playback is buffering data. see: IsConnecting, IsLooping, IsPaused, IsPlaying, IsPreparing, IsReady

Returns:

true if looping, false otherwise.

Return type:

bool

is_closed() bool

Whether media is currently closed.

Returns:

true if media is closed, false otherwise.

Return type:

bool

is_connecting() bool

Check whether the player is currently connecting to a media source. see: IsBuffering, IsLooping, IsPaused, IsPlaying, IsPreparing, IsReady

Returns:

true if connecting, false otherwise.

Return type:

bool

is_looping() bool

Check whether playback is looping. see: IsBuffering, IsConnecting, IsPaused, IsPlaying, IsPreparing, IsReady, SetLooping

Returns:

true if looping, false otherwise.

Return type:

bool

is_paused() bool

Check whether playback is currently paused. see: CanPause, IsBuffering, IsConnecting, IsLooping, IsPaused, IsPlaying, IsPreparing, IsReady, Pause

Returns:

true if playback is paused, false otherwise.

Return type:

bool

is_playing() bool

Check whether playback has started. see: CanPlay, IsBuffering, IsConnecting, IsLooping, IsPaused, IsPlaying, IsPreparing, IsReady, Play

Returns:

true if playback has started, false otherwise.

Return type:

bool

is_preparing() bool

Check whether the media is currently opening or buffering. see: CanPlay, IsBuffering, IsConnecting, IsLooping, IsPaused, IsPlaying, IsReady, Play

Returns:

true if playback is being prepared, false otherwise.

Return type:

bool

is_ready() bool

Check 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. see: HasError, IsBuffering, IsConnecting, IsLooping, IsPaused, IsPlaying, IsPreparing

Returns:

true if media is ready, false otherwise.

Return type:

bool

property loop: bool

[Read-Only] Loop: Whether the player should loop when media playback reaches the end.

Use the SetLooping function to change this value at runtime. see: IsLooping, SetLooping

Type:

(bool)

property native_audio_out: bool

[Read-Write] Native Audio Out: Output any audio via the operating system’s sound mixer instead of a Sound Wave asset.

If enabled, the assigned Sound Wave asset will be ignored. The SetNativeVolume function can then be used to change the audio output volume at runtime. Note that not all media player plug-ins may support native audio output on all platforms. see: SetNativeVolume

Type:

(bool)

next() bool

Open the next item in the current play list.

The player will start playing the new media source if it was playing something previously, otherwise it will only open the media source. see: Close, OpenUrl, OpenSource, Play, Previous, SetPlaylist

Returns:

true on success, false otherwise.

Return type:

bool

property on_end_reached: OnMediaPlayerMediaEvent

[Read-Write] On End Reached: A delegate that is invoked when playback has reached the end of the media.

Type:

(OnMediaPlayerMediaEvent)

property on_media_closed: OnMediaPlayerMediaEvent

[Read-Write] On Media Closed: A delegate that is invoked when a media source has been closed.

Type:

(OnMediaPlayerMediaEvent)

property on_media_open_failed: OnMediaPlayerMediaOpenFailed

[Read-Write] On Media Open Failed: A delegate that is invoked when a media source has failed to open.

This delegate is only executed if OpenSource / OpenUrl returned true and the media failed to open asynchronously later. It is not executed if OpenSource / OpenUrl returned false, indicating an immediate failure. see: OnMediaOpened

Type:

(OnMediaPlayerMediaOpenFailed)

property on_media_opened: OnMediaPlayerMediaOpened

[Read-Write] On Media Opened: A delegate that is invoked when a media source has been opened.

Depending on whether the underlying player implementation opens the media synchronously or asynchronously, this event may be executed before or after the call to OpenSource / OpenUrl returns. see: OnMediaOpenFailed, OnTracksChanged

Type:

(OnMediaPlayerMediaOpened)

property on_playback_resumed: OnMediaPlayerMediaEvent

[Read-Write] On Playback Resumed: A delegate that is invoked when media playback has been resumed. see: OnPlaybackSuspended

Type:

(OnMediaPlayerMediaEvent)

property on_playback_suspended: OnMediaPlayerMediaEvent

[Read-Write] On Playback Suspended: A delegate that is invoked when media playback has been suspended. see: OnPlaybackResumed

Type:

(OnMediaPlayerMediaEvent)

property on_seek_completed: OnMediaPlayerMediaEvent

[Read-Write] On Seek Completed: A delegate that is invoked when a seek operation completed successfully.

Depending on whether the underlying player implementation performs seeks synchronously or asynchronously, this event may be executed before or after the call to Seek returns.

Type:

(OnMediaPlayerMediaEvent)

property on_tracks_changed: OnMediaPlayerMediaEvent

[Read-Write] On Tracks Changed: A delegate that is invoked when the media track collection changed. see: OnMediaOpened

Type:

(OnMediaPlayerMediaEvent)

open_file(file_path) bool

Opens the specified media file path.

A return value of true indicates that the player will attempt to open the media, but it may fail to do so later for other reasons, i.e. if a connection to the media server timed out. Use the OnMediaOpened and OnMediaOpenFailed delegates to detect if and when the media is ready! see: GetUrl, Close, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Reopen

Parameters:

file_path (str) – The file path to open.

Returns:

true if the file path will be opened, false otherwise.

Return type:

bool

open_playlist(playlist) bool

Open the first media source in the specified play list. see: Close, OpenFile, OpenPlaylistIndex, OpenSource, OpenUrl, Reopen

Parameters:

playlist (MediaPlaylist) – The play list to open.

Returns:

true if the source will be opened, false otherwise.

Return type:

bool

open_playlist_index(playlist, index) bool

Open a particular media source in the specified play list. see: Close, OpenFile, OpenPlaylist, OpenSource, OpenUrl, Reopen

Parameters:
  • playlist (MediaPlaylist) – The play list to open.

  • index (int32) – The index of the source to open.

Returns:

true if the source will be opened, false otherwise.

Return type:

bool

open_source(media_source) bool

Open the specified media source.

A return value of true indicates that the player will attempt to open the media, but it may fail to do so later for other reasons, i.e. if a connection to the media server timed out. Use the OnMediaOpened and OnMediaOpenFailed delegates to detect if and when the media is ready! see: Close, OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenUrl, Reopen

Parameters:

media_source (MediaSource) – The media source to open.

Returns:

true if the source will be opened, false otherwise.

Return type:

bool

open_source_latent(world_context_object, latent_info, media_source, options) bool

Open the specified media source with options using a latent action.

A result of true indicates that the player successfully completed all requested operations. see: Close, OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenUrl, Reopen

Parameters:
Returns:

success (bool): All requested operations have completed successfully.

Return type:

bool

open_source_with_options(media_source, options) bool

Open the specified media source with supplied options applied.

A return value of true indicates that the player will attempt to open the media, but it may fail to do so later for other reasons, i.e. if a connection to the media server timed out. Use the OnMediaOpened and OnMediaOpenFailed delegates to detect if and when the media is ready! see: Close, OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenUrl, Reopen

Parameters:
Returns:

true if the source will be opened, false otherwise.

Return type:

bool

open_url(url) bool

Opens the specified media URL.

A return value of true indicates that the player will attempt to open the media, but it may fail to do so later for other reasons, i.e. if a connection to the media server timed out. Use the OnMediaOpened and OnMediaOpenFailed delegates to detect if and when the media is ready! see: GetUrl, Close, OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, Reopen

Parameters:

url (str) – The URL to open.

Returns:

true if the URL will be opened, false otherwise.

Return type:

bool

pause() bool

Pauses media playback.

This is the same as setting the playback rate to 0.0. see: CanPause, Close, Next, Play, Previous, Rewind, Seek

Returns:

true if playback is being paused, false otherwise.

Return type:

bool

play() bool

Starts media playback.

This is the same as setting the playback rate to 1.0. see: CanPlay, GetRate, Next, Pause, Previous, SetRate

Returns:

true if playback is starting, false otherwise.

Return type:

bool

play_and_seek() None

Starts playback from the media opened event, but can be used elsewhere.

property play_on_open: bool

[Read-Write] Play on Open: Automatically start playback after media opened successfully.

If disabled, listen to the OnMediaOpened Blueprint event to detect when the media finished opening, and then start playback using the Play function. see: OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Play

Type:

(bool)

property playlist: MediaPlaylist

[Read-Only] Playlist: The play list to use, if any.

Use the OpenPlaylist or OpenPlaylistIndex function to change this value at runtime. see: OpenPlaylist, OpenPlaylistIndex

Type:

(MediaPlaylist)

property playlist_index: int

[Read-Only] Playlist Index: The current index of the source in the play list being played.

Use the Previous and Next methods to change this value at runtime. see: Next, Previous

Type:

(int32)

previous() bool

Open the previous item in the current play list.

The player will start playing the new media source if it was playing something previously, otherwise it will only open the media source. see: Close, Next, OpenUrl, OpenSource, Play, SetPlaylist

Returns:

true on success, false otherwise.

Return type:

bool

reopen() bool

Reopens the currently opened media or play list. see: Close, Open, OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl

Returns:

true if the media will be opened, false otherwise.

Return type:

bool

rewind() bool

Rewinds the media to the beginning.

This is the same as seeking to zero time. see: GetTime, Seek

Returns:

true if rewinding, false otherwise.

Return type:

bool

seek(time) bool

Seeks to the specified playback time. see: GetTime, Rewind

Parameters:

time (Timespan) – The playback time to set.

Returns:

true on success, false otherwise.

Return type:

bool

select_track(track_type, track_index) bool

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. see: GetNumTracks, GetSelectedTrack, SetTrackFormat

Parameters:
  • track_type (MediaPlayerTrack) – The type of track to select.

  • track_index (int32) – The index of the track to select, or INDEX_NONE to deselect.

Returns:

true if the track was selected, false otherwise.

Return type:

bool

set_block_on_time(time) None

Set the time on which to block.

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

Parameters:

time (Timespan) – The time to block on, or FTimespan::MinValue to disable.

set_desired_player_name(player_name) None

Set the name of the desired native player. see: GetDesiredPlayerName

Parameters:

player_name (Name) – The name of the player to set.

set_looping(looping) bool

Enables or disables playback looping. see: IsLooping

Parameters:

looping (bool) – Whether playback should be looped.

Returns:

true on success, false otherwise.

Return type:

bool

set_media_options(options) None

Sets the media options used by the player.

Parameters:

options (MediaSource) – Options to pass to the player.

set_native_volume(volume) bool

Set the volume on the native player if not mixing with Sound Wave asset.

The SetNativeVolume can be used to change the audio output volume at runtime. Note that not all media player plug-ins may support native audio output on all platforms. see: NativeAudioOut

Parameters:

volume (float) – The volume to set.

Returns:

true on success, false otherwise.

Return type:

bool

set_rate(rate) bool

Changes the media’s playback rate. see: GetRate, SupportsRate

Parameters:

rate (float) – The playback rate to set.

Returns:

true on success, false otherwise.

Return type:

bool

set_time_delay(time_delay) None

Delay of the player’s time.

This setting can be used to manually sync multiple sources. Set to 1 seconds, if you would like that Player to play 1 second behind its current time. If the value is too big, it is possible that the player would not hold that frame for that long. see: GetTimeDelay

Parameters:

time_delay (Timespan) –

set_track_format(track_type, track_index, format_index) bool

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. see: GetNumTrackFormats, GetNumTracks, GetTrackFormat, SelectTrack

Parameters:
  • track_type (MediaPlayerTrack) – The type of track to update.

  • track_index (int32) – The index of the track to update.

  • format_index (int32) – The index of the format to select (must be valid).

Returns:

true if the track was selected, false otherwise.

Return type:

bool

set_video_track_frame_rate(track_index, format_index, frame_rate) bool

Set the frame rate of the specified video track. see: GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

Parameters:
  • track_index (int32) – The index of the track, or INDEX_NONE for the selected one.

  • format_index (int32) – Index of the track format, or INDEX_NONE for the selected one.

  • frame_rate (float) – The frame rate to set (must be in range of format’s supported frame rates).

Returns:

true on success, false otherwise.

Return type:

bool

set_view_field(horizontal, vertical, absolute) bool

Set the field of view (only for 360 videos). see: GetHorizontalFieldOfView, GetVerticalFieldOfView, SetViewRotation

Parameters:
  • horizontal (float) – Horizontal field of view (in Euler degrees).

  • vertical (float) – Vertical field of view (in Euler degrees).

  • absolute (bool) –

Returns:

true on success, false otherwise.

Return type:

bool

set_view_rotation(rotation, absolute) bool

Set the view’s rotation (only for 360 videos). see: GetViewRotation, SetViewField

Parameters:
  • rotation (Rotator) – The desired view rotation.

  • absolute (bool) –

Returns:

true on success, false otherwise.

Return type:

bool

property shuffle: bool

[Read-Write] Shuffle: Whether playback should shuffle media sources in the play list. see: OpenPlaylist, OpenPlaylistIndex

Type:

(bool)

supports_rate(rate, unthinned) bool

Check whether the specified playback rate is supported. see: SupportsScrubbing, SupportsSeeking

Parameters:
  • rate (float) – The playback rate to check.

  • unthinned (bool) – Whether no frames should be dropped at the given rate.

Return type:

bool

supports_scrubbing() bool

Check whether the currently loaded media supports scrubbing. see: SupportsRate, SupportsSeeking

Returns:

true if scrubbing is supported, false otherwise.

Return type:

bool

supports_seeking() bool

Check whether the currently loaded media can jump to a certain position. see: SupportsRate, SupportsScrubbing

Returns:

true if seeking is supported, false otherwise.

Return type:

bool

property time_delay: Timespan

[Read-Only] Time Delay: Delay of the player’s time. see: SetTimeDelay, GetTimeDelay

Type:

(Timespan)