unreal.BinkMediaPlayer¶
- class unreal.BinkMediaPlayer(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
ObjectImplements a media player asset that can play movies and other media.
This class is represents a media URL along with a corresponding media player for exposing media playback functionality to the Engine and to Blueprints.
C++ Source:
Plugin: BinkMedia
Module: BinkMediaPlayer
File: BinkMediaPlayer.h
Editor Properties: (see get_editor_property/set_editor_property)
bink_buffer_mode(BinkMediaPlayerBinkBufferModes): [Read-Write] Used to specify the how the video should be buffered.bink_destination_lower_right(Vector2D): [Read-Write] Used to specify the sounds to open at playback.bink_destination_upper_left(Vector2D): [Read-Write] Used to specify the sounds to open at playback.bink_draw_style(BinkMediaPlayerBinkDrawStyle): [Read-Write] Used to specify how the movie is drawn.bink_layer_depth(int32): [Read-Write] Used to specify the render order.bink_sound_track(BinkMediaPlayerBinkSoundTrack): [Read-Write] Used to specify the sounds to open at playback.bink_sound_track_start(int32): [Read-Write] Used to specify the sounds to open at playback.delayed_open(bool): [Read-Write] To reduce memory use, don’t immediately open the bink until it is first played.looping(bool): [Read-Write] Whether playback should loop when it reaches the end.on_media_closed(OnBinkMediaPlayerMediaClosed): [Read-Write] Holds a delegate that is invoked when a media source has been closed.on_media_opened(OnBinkMediaPlayerMediaOpened): [Read-Write] Holds a delegate that is invoked when a media source has been opened.on_media_reached_end(OnBinkMediaPlayerMediaReachedEnd): [Read-Write] Holds a delegate that is invoked when a media source has been opened.on_playback_suspended(OnBinkMediaPlayerMediaEvent): [Read-Write] A delegate that is invoked when media playback has been suspended.start_immediately(bool): [Read-Write] Whether playback start immediately, or wait for blueprint to start it.url(str): [Read-Write] The path or URL to the media file to be played.
- property bink_buffer_mode: BinkMediaPlayerBinkBufferModes¶
[Read-Only] Used to specify the how the video should be buffered.
- Type:
- property bink_draw_style: BinkMediaPlayerBinkDrawStyle¶
[Read-Only] Used to specify how the movie is drawn.
- Type:
- property bink_sound_track: BinkMediaPlayerBinkSoundTrack¶
[Read-Only] Used to specify the sounds to open at playback.
- Type:
- property bink_sound_track_start: int¶
[Read-Only] Used to specify the sounds to open at playback.
- Type:
(int32)
- can_pause() bool¶
Checks whether media playback can be paused right now.
Playback can be paused if the media supports pausing and if it is currently playing.
- Returns:
true if pausing playback can be paused, false otherwise. See: CanPlay, Pause
- Return type:
- can_play() bool¶
Checks whether media playback can be started right now.
- Returns:
true if playback can be started, false otherwise. See: CanPause, Play
- Return type:
- draw(texture, tonemap=False, out_nits=10000, alpha=1.000000, srgb_decode=False, hdr=False) None¶
Draws this bink to the specified texture
- get_duration() Timespan¶
Gets the media’s duration.
- Returns:
A time span representing the duration. See: GetTime, Seek
- Return type:
- get_rate() float¶
Gets the media’s current playback rate.
- Returns:
The playback rate. See: SetRate, SupportsRate
- Return type:
- get_time() Timespan¶
Gets the media’s current playback time.
- Returns:
Playback time. See: GetDuration, Seek
- Return type:
- get_url() str¶
Gets the URL of the currently loaded media, if any.
- Returns:
Media URL, or empty string if no media was loaded. See: OpenUrl
- Return type:
- is_initialized() bool¶
Checks whether this player has been initialized with a media source.
- Returns:
true if a media source is associated with this player. See: OpenUrl
- Return type:
- is_looping() bool¶
Checks whether playback is looping.
- Returns:
true if looping, false otherwise. See: SetLooping
- Return type:
- is_paused() bool¶
Checks whether playback is currently paused.
- Returns:
true if playback is paused, false otherwise. See: CanPause, IsPlaying, IsStopped, Pause
- Return type:
- is_playing() bool¶
Checks whether playback has started.
- Returns:
true if playback has started, false otherwise. See: CanPlay, IsPaused, IsStopped, Play
- Return type:
- is_stopped() bool¶
Checks whether playback has stopped.
- Returns:
true if playback has stopped, false otherwise. See: IsPaused, IsPlaying, Stop
- Return type:
- property on_media_closed: OnBinkMediaPlayerMediaClosed¶
[Read-Write] Holds a delegate that is invoked when a media source has been closed.
- Type:
- property on_media_opened: OnBinkMediaPlayerMediaOpened¶
[Read-Write] Holds a delegate that is invoked when a media source has been opened.
- Type:
- property on_media_reached_end: OnBinkMediaPlayerMediaReachedEnd¶
[Read-Write] Holds a delegate that is invoked when a media source has been opened.
- Type:
- property on_playback_suspended: OnBinkMediaPlayerMediaEvent¶
[Read-Write] A delegate that is invoked when media playback has been suspended.
- Type:
- pause() bool¶
Pauses media playback.
This is the same as setting the playback rate to 0.0.
- Returns:
true if playback is being paused, false otherwise. See: CanPause, Play, Rewind, Seek, SetRate
- Return type:
- play() bool¶
Starts media playback.
This is the same as setting the playback rate to 1.0.
- Returns:
true if playback is starting, false otherwise. See: CanPlay, Pause, Rewind, Seek, SetRate
- Return type:
- rewind() bool¶
Rewinds the media to the beginning.
This is the same as seeking to zero time.
- Returns:
true if rewinding, false otherwise. See: GetTime, Pause, Play, Seek
- Return type:
- set_volume(rate) None¶
Changes the media’s volume
- Parameters:
rate (float) – The playback volume to set. 0 to 1
- stop() None¶
Stops playback and unloads the video from memory. If you want to start the video again you’ll need to call InitializePlayer. MediaEvent will broadcast EMediaEvent::MediaClosed.