unreal.MediaPlaylist

class unreal.MediaPlaylist(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

Implements a media play list.

C++ Source:

  • Module: MediaAssets

  • File: MediaPlaylist.h

Editor Properties: (see get_editor_property/set_editor_property)

  • items (Array[MediaSource]): [Read-Write] List of media sources to play.

add(media_source) bool

Add a media source to the play list. see: AddFile, AddUrl, Insert, RemoveAll, Remove, Replace

Parameters:

media_source (MediaSource) – The media source to append.

Returns:

true if the media source was added, false otherwise.

Return type:

bool

add_file(file_path) bool

Add a media file path to the play list. see: Add, AddUrl, Insert, RemoveAll, Remove, Replace

Parameters:

file_path (str) – The file path to add.

Returns:

true if the file was added, false otherwise.

Return type:

bool

add_url(url) bool

Add a media URL to the play list. see: Add, AddFile, Insert, RemoveAll, Remove, Replace

Parameters:

url (str) – The URL to add.

Returns:

true if the URL was added, false otherwise.

Return type:

bool

get(index) MediaSource

Get the media source at the specified index. see: GetNext, GetRandom

Parameters:

index (int32) – The index of the media source to get.

Returns:

The media source, or nullptr if the index doesn’t exist.

Return type:

MediaSource

get_next() -> (MediaSource, out_index=int32)

Get the next media source in the play list. see: , GetPrevious, GetRandom

Returns:

The media source after the current one, or nullptr if the list is empty.

out_index (int32): Index of the current media source (will contain the new index).

Return type:

int32

get_previous() -> (MediaSource, out_index=int32)

Get the previous media source in the play list. see: , GetNext, GetRandom

Returns:

The media source before the current one, or nullptr if the list is empty.

out_index (int32): Index of the current media source (will contain the new index).

Return type:

int32

get_random() -> (MediaSource, out_index=int32)

Get a random media source in the play list. see: Get, GetNext, GetPrevious

Returns:

The random media source, or nullptr if the list is empty.

out_index (int32): Will contain the index of the returned media source.

Return type:

int32

insert(media_source, index) None

Insert a media source into the play list at the given position. see: Add, Remove, RemoveAll, Replace

Parameters:
  • media_source (MediaSource) – The media source to insert.

  • index (int32) – The index to insert into.

num() int32

Get the number of media sources in the play list.

Returns:

Number of media sources.

Return type:

int32

remove(media_source) bool

Remove all occurrences of the given media source in the play list. see: Add, Insert, Remove, Replace

Parameters:

media_source (MediaSource) – The media source to remove.

Returns:

true if the media source was removed, false otherwise.

Return type:

bool

remove_at(index) bool

Remove the media source at the specified position. see: Add, Insert, RemoveAll, Replace

Parameters:

index (int32) – The index of the media source to remove.

Returns:

true if the media source was removed, false otherwise.

Return type:

bool

replace(index, replacement) bool

Replace the media source at the specified position. see: Add, Insert, RemoveAll, RemoveAt

Parameters:
  • index (int32) – The index of the media source to replace.

  • replacement (MediaSource) – The replacement media source.

Returns:

true if the media source was replaced, false otherwise.

Return type:

bool