unreal.BinkMediaPlayer
¶
- class unreal.BinkMediaPlayer(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
Object
Implements 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. see: CanPlay, Pause
- Returns:
true if pausing playback can be paused, false otherwise.
- Return type:
- can_play() bool ¶
Checks whether media playback can be started right now. see: CanPause, Play
- Returns:
true if playback can be started, false otherwise.
- 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. see: GetTime, Seek
- Returns:
A time span representing the duration.
- Return type:
- get_rate() float ¶
Gets the media’s current playback rate. see: SetRate, SupportsRate
- Returns:
The playback rate.
- Return type:
- get_time() Timespan ¶
Gets the media’s current playback time. see: GetDuration, Seek
- Returns:
Playback time.
- Return type:
- get_url() str ¶
Gets the URL of the currently loaded media, if any. see: OpenUrl
- Returns:
Media URL, or empty string if no media was loaded.
- Return type:
- is_initialized() bool ¶
Checks whether this player has been initialized with a media source. see: OpenUrl
- Returns:
true if a media source is associated with this player.
- Return type:
- is_looping() bool ¶
Checks whether playback is looping. see: SetLooping
- Returns:
true if looping, false otherwise.
- Return type:
- is_paused() bool ¶
Checks whether playback is currently paused. see: CanPause, IsPlaying, IsStopped, Pause
- Returns:
true if playback is paused, false otherwise.
- Return type:
- is_playing() bool ¶
Checks whether playback has started. see: CanPlay, IsPaused, IsStopped, Play
- Returns:
true if playback has started, false otherwise.
- Return type:
- is_stopped() bool ¶
Checks whether playback has stopped. see: IsPaused, IsPlaying, Stop
- Returns:
true if playback has stopped, false otherwise.
- 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. see: CanPause, Play, Rewind, Seek, SetRate
- Returns:
true if playback is being paused, false otherwise.
- Return type:
- play() bool ¶
Starts media playback.
This is the same as setting the playback rate to 1.0. see: CanPlay, Pause, Rewind, Seek, SetRate
- Returns:
true if playback is starting, false otherwise.
- Return type:
- rewind() bool ¶
Rewinds the media to the beginning.
This is the same as seeking to zero time. see: GetTime, Pause, Play, Seek
- Returns:
true if rewinding, false otherwise.
- 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. see: InitializePlayer, IsStopped, Play
- supports_rate(rate, unthinned) bool ¶
Checks whether the specified playback rate is supported. see: SupportsScrubbing, SupportsSeeking