unreal.MediaStream

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

Bases: Object

Media Stream. Provides an agnostic interface between controllers and players.

C++ Source:

  • Plugin: MediaStream

  • Module: MediaStream

  • File: MediaStream.h

Editor Properties: (see get_editor_property/set_editor_property)

  • on_source_changed (OnSourceChanged): [Read-Write]

  • player_object (Object): [Read-Only] The player instance is automatically created based on the type of source. Where possible, the player is re-used when opening new media.

  • source (MediaStreamSource): [Read-Write]

ensure_player(force_recreate_player=False) bool

Creates a player if it doesn’t exist.

Parameters:

force_recreate_player (bool) – Will remove and recreate the player.

Returns:

True if a valid player exists.

Return type:

bool

get_player() MediaStreamPlayer
Returns:

Gets the active Media Stream Player.

Return type:

MediaStreamPlayer

get_source() MediaStreamSource
Returns:

The current Media Stream Source. Does not guaranteed that it is valid.

Return type:

MediaStreamSource

has_valid_source() bool
Returns:

True if the media source scheme is not empty. Does not guarantee the source is correct, only valid.

Return type:

bool

property on_source_changed: OnSourceChanged

[Read-Write]

Type:

(OnSourceChanged)

property player_object: Object

[Read-Only] The player instance is automatically created based on the type of source. Where possible, the player is re-used when opening new media.

Type:

(Object)

resolve_source() MediaStreamSource
Returns:

The source at the end of the chain of proxy players, or the local one if it is local. If the chain is interrupted, the last link in the chain’s source will be returned.

Return type:

MediaStreamSource

set_source(source) bool

Sets a new Media Stream Source and inits the Player. It should be ready to use if this returns true.

Parameters:

source (MediaStreamSource) – The new source.

Returns:

True if the source was successfully applied.

Return type:

bool

property source: MediaStreamSource

[Read-Write]

Type:

(MediaStreamSource)