unreal.MediaPlayer

class unreal.MediaPlayer(outer=None, name='None')

Bases: unreal.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] Whether this player should stop when entering or exiting PIE.

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

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

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

  • horizontal_field_of_view (float): [Read-Write] 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. GetHorizontalFieldOfView, SetHorizontalFieldOfView, VerticalFieldOfView, ViewRotation:

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

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

  • native_audio_out (bool): [Read-Write] 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. SetNativeVolume:

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

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

  • on_media_open_failed (OnMediaPlayerMediaOpenFailed): [Read-Write] 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. OnMediaOpened:

  • on_media_opened (OnMediaPlayerMediaOpened): [Read-Write] 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. OnMediaOpenFailed, OnTracksChanged:

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

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

  • on_seek_completed (OnMediaPlayerMediaEvent): [Read-Write] 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] A delegate that is invoked when the media track collection changed. OnMediaOpened:

  • play_on_open (bool): [Read-Write] 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. OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Play:

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

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

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

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

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

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

  • vertical_field_of_view (float): [Read-Write] 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. GetVerticalFieldOfView, SetVerticalFieldOfView, HorizontalFieldOfView, ViewRotation:

  • view_rotation (Rotator): [Read-Write] 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. GetViewRotation, SetViewRotation, HorizontalFieldOfView, VerticalFieldOfView:

property affected_by_pie_handling

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

Type

(bool)

property cache_ahead

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

Type

(Timespan)

property cache_behind

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

Type

(Timespan)

property cache_behind_game

[Read-Write] Duration of samples to cache behind the play head (when running as game). 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. 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. 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. CanPlaySource, SetDesiredPlayerName:

Parameters

url (str) – The URL to check.

Returns

Return type

bool

close()None

Close the currently open media, if any. 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. 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. 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. 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. 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. 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). 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. 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. 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. 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. 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. GetPlaylistIndex, GetPlaylistRef:

Returns

The play list.

Return type

MediaPlaylist

get_playlist_index() → int32

Get the current play list index. GetPlaylist:

Returns

Play list index.

Return type

int32

get_rate()float

Get the media’s current playback rate. 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. 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)

Get the supported playback rates. 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. GetDuration, Seek:

Returns

Playback time.

Return type

Timespan

get_time_delay()Timespan

Delay of the player’s time. 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. 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. 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. 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. 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. 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). 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. 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. 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. 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. 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. 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). 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. IsReady:

Returns

Return type

bool

is_buffering()bool

Check whether playback is buffering data. 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. IsBuffering, IsLooping, IsPaused, IsPlaying, IsPreparing, IsReady:

Returns

true if connecting, false otherwise.

Return type

bool

is_looping()bool

Check whether playback is looping. 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. 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. 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. 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. HasError, IsBuffering, IsConnecting, IsLooping, IsPaused, IsPlaying, IsPreparing:

Returns

true if media is ready, false otherwise.

Return type

bool

property loop

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

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

Type

(bool)

property native_audio_out

[Read-Write] 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. 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. Close, OpenUrl, OpenSource, Play, Previous, SetPlaylist:

Returns

true on success, false otherwise.

Return type

bool

property on_end_reached

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

Type

(OnMediaPlayerMediaEvent)

property on_media_closed

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

Type

(OnMediaPlayerMediaEvent)

property on_media_open_failed

[Read-Write] 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. OnMediaOpened:

Type

(OnMediaPlayerMediaOpenFailed)

property on_media_opened

[Read-Write] 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. OnMediaOpenFailed, OnTracksChanged:

Type

(OnMediaPlayerMediaOpened)

property on_playback_resumed

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

Type

(OnMediaPlayerMediaEvent)

property on_playback_suspended

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

Type

(OnMediaPlayerMediaEvent)

property on_seek_completed

[Read-Write] 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

[Read-Write] A delegate that is invoked when the media track collection changed. 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! 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. 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. 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! 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. 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! 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! 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. 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. 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

[Read-Write] 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. OpenFile, OpenPlaylist, OpenPlaylistIndex, OpenSource, OpenUrl, Play:

Type

(bool)

property playlist

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

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

Type

(MediaPlaylist)

property playlist_index

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

Use the Previous and Next methods to change this value at runtime. 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. 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. 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. GetTime, Seek:

Returns

true if rewinding, false otherwise.

Return type

bool

seek(time)bool

Seeks to the specified playback time. 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. 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 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. GetDesiredPlayerName:

Parameters

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

set_looping(looping)bool

Enables or disables playback looping. 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. 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. 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 his current time. If the value is too big, it is possible that the player would not hold that frame for that long. GetTimeDelay:

Parameters

time_delay (Timespan) –

Returns

true on success, false otherwise.

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. 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. 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). 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). GetViewRotation, SetViewField:

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

  • absolute (bool) –

Returns

true on success, false otherwise.

Return type

bool

property shuffle

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

Type

(bool)

supports_rate(rate, unthinned)bool

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

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

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

Returns

Return type

bool

supports_scrubbing()bool

Check whether the currently loaded media supports scrubbing. 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. SupportsRate, SupportsScrubbing:

Returns

true if seeking is supported, false otherwise.

Return type

bool

property time_delay

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

Type

(Timespan)