UBinkMediaPlayer

Implements a media player asset that can play movies and other media.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

BinkMediaPlayer

Header

/Engine/Plugins/Media/BinkMedia/Source/BinkMediaPlayer/Public/BinkMediaPlayer.h

Include

#include "BinkMediaPlayer.h"

Syntax

UCLASS(BlueprintType, HideCategories=(Object))
class UBinkMediaPlayer :
    public UObject,
    public FTickableGameObject

Remarks

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.

Variables

Name Description

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< EB...

 

BinkBufferMode

Used to specify the how the video should be buffered.

Public variable UProperty Category, EditAnywhere

FVector2D

 

BinkDestinationLowerRight

Used to specify the sounds to open at playback.

Public variable UProperty Category, EditAnywhere

FVector2D

 

BinkDestinationUpperLeft

Used to specify the sounds to open at playback.

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< EB...

 

BinkDrawStyle

Used to specify how the movie is drawn.

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

int32

 

BinkLayerDepth

Used to specify the render order.

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< EB...

 

BinkSoundTrack

Used to specify the sounds to open at playback.

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

int32

 

BinkSoundTrackStart

Used to specify the sounds to open at playback.

Public variable

BINKPLUGIN *...

 

bnk

Public variable

TEnumAsByte< EB...

 

CurrentBinkBufferMode

Holds the bink buffer mode of the currently loaded media source.

Public variable

TEnumAsByte< EB...

 

CurrentBinkSoundTrack

Holds the bink sound track of the currently loaded media source.

Public variable

int32

 

CurrentBinkSoundTrackStart

Holds the bink sound track start of the currently loaded media source.

Public variable

EBinkMediaPlaye...

 

CurrentDrawStyle

Public variable

int32

 

CurrentLayerDepth

Public variable

FString

 

CurrentUrl

Public variable UProperty Category, EditAnywhere

uint32: 1

 

DelayedOpen

To reduce memory use, don't immediately open the bink until it is first played.

Public variable UProperty Category, EditAnywhere

uint32: 1

 

Looping

Whether playback should loop when it reaches the end.

Public variable

FOnMediaChanged

 

MediaChangedEvent

Holds a delegate that is executed when media has been opened or closed.

Public variable UProperty Category BlueprintAssignable

FOnBinkMediaPla...

 

OnMediaClosed

Holds a delegate that is invoked when a media source has been closed.

Public variable UProperty Category BlueprintAssignable

FOnBinkMediaPla...

 

OnMediaOpened

Holds a delegate that is invoked when a media source has been opened.

Public variable UProperty Category BlueprintAssignable

FOnBinkMediaPla...

 

OnMediaReachedEnd

Holds a delegate that is invoked when a media source has been opened.

Public variable UProperty Category, Meta BlueprintAssignable

FOnBinkMediaPla...

 

OnPlaybackSuspended

A delegate that is invoked when media playback has been suspended.

Public variable

FDelegateHandle

 

overlayHook

Public variable

bool

 

paused

Public variable

bool

 

reached_end

Public variable UProperty Category, EditAnywhere

uint32: 1

 

StartImmediately

Whether playback start immediately, or wait for blueprint to start it.

Public variable UProperty Category, EditAnywhere

FString

 

URL

The path or URL to the media file to be played.

Constructors

Name Description

Public function

UBinkMediaPlayer

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const UFunction BlueprintCallable, Category

bool

 

CanPause()

Checks whether media playback can be paused right now.

Public function Const UFunction BlueprintCallable, Category

bool

 

CanPlay()

Checks whether media playback can be started right now.

Public function

void

 

Close()

Public function UFunction BlueprintCallable, Category

void

 

CloseUrl()

Opens the specified media URL.

Public function UFunction BlueprintCallable, Category

void

 

Draw

(
    UTexture* texture,
    bool tonemap,
    int out_nits,
    float alpha,
    bool srgb_decode,
    bool hdr
)

Draws this bink to the specified texture

Public function Const

FIntPoint

 

GetDimensions()

Public function Const UFunction BlueprintCallable, Category

FTimespan

 

GetDuration()

Gets the media's duration.

Public function Const

float

 

GetFrameRate()

Public function Const UFunction BlueprintCallable, Category

float

 

GetRate()

Gets the media's current playback rate.

Public function Const UFunction BlueprintCallable, Category

FTimespan

 

GetTime()

Gets the media's current playback time.

Public function Const UFunction BlueprintCallable, Category

const FStrin...

 

GetUrl()

Gets the URL of the currently loaded media, if any.

Public function

void

 

HandleMediaPlayerMediaClosed()

Callback for when the media player has closed a media source.

Public function

void

 

HandleMediaPlayerMediaOpened

(
    FString OpenedUrl
)

Callback for when the media player has opened a new media source.

Public function

void

 

InitializePlayer()

Initializes the media player.

Public function Const UFunction BlueprintCallable, Category

bool

 

IsInitialized()

Checks whether this player has been initialized with a media source.

Public function Const UFunction BlueprintCallable, Category

bool

 

IsLooping()

Checks whether playback is looping.

Public function Const UFunction BlueprintCallable, Category

bool

 

IsPaused()

Checks whether playback is currently paused.

Public function Const UFunction BlueprintCallable, Category

bool

 

IsPlaying()

Checks whether playback has started.

Public function Const

bool

 

IsReady()

Public function Const UFunction BlueprintCallable, Category

bool

 

IsStopped()

Checks whether playback has stopped.

Public function UFunction BlueprintCallable, Category

UBinkMediaPl...

 

OnMediaChanged()

Public function

bool

 

Open

(
    const FString& Url
)

Public function UFunction BlueprintCallable, Category

bool

 

OpenUrl

(
    const FString& NewUrl
)

Opens the specified media URL.

Public function UFunction BlueprintCallable, Category

bool

 

Pause()

Pauses media playback.

This is the same as setting the playback rate to 0.0.

Public function UFunction BlueprintCallable, Category

bool

 

Play()

Starts media playback.

This is the same as setting the playback rate to 1.0.

Public function UFunction BlueprintCallable, Category

bool

 

Rewind()

Rewinds the media to the beginning.

This is the same as seeking to zero time.

Public function UFunction BlueprintCallable, Category

bool

 

Seek

(
    const FTimespan& InTime
)

Seeks to the specified playback time.

Public function UFunction BlueprintCallable, Category

bool

 

SetLooping

(
    bool InLooping
)

Enables or disables playback looping.

Public function UFunction BlueprintCallable, Category

bool

 

SetRate

(
    float Rate
)

Changes the media's playback rate.

Public function UFunction BlueprintCallable, Category

void

 

SetVolume

(
    float Rate
)

Changes the media's volume

Public function UFunction BlueprintCallable, Category

void

 

Stop()

Stops playback and unloads the video from memory.

Public function Const UFunction BlueprintCallable, Category

bool

 

SupportsRate

(
    float Rate,
    bool Unthinned
)

Checks whether the specified playback rate is supported.

Public function Const UFunction BlueprintCallable, Category

bool

 

SupportsScrubbing()

Checks whether the currently loaded media supports scrubbing.

Public function Const UFunction BlueprintCallable, Category

bool

 

SupportsSeeking()

Checks whether the currently loaded media can jump to a certain position.

Public function

void

 

UpdateTexture

(
    FRHICommandListImmediate& RHICmdLi...,
    FTextureRHIRef ref,
    void* nativePtr,
    int width,
    int height,
    bool isEditor,
    bool tonemap,
    int output_nits,
    float alpha,
    bool srgb_decode,
    bool is_hdr
)

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

UMediaPlayerBase overrides not already part of the build provided by RAD virtual TSharedRef GetPlayerFacade() const override; virtual bool IsPreparing() const override { return !IsReady(); } virtual bool OpenSource(UMediaSource* InMediaSource) override;

Public function Virtual

FString

 

GetDesc()

Return a one line description of an object for viewing in the thumbnail view of the generic browser

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Overridden from FTickableGameObject

Name Description

Public function Virtual Const

bool

 

IsTickableInEditor()

Used to determine whether the object should be ticked in the editor.

Overridden from FTickableObjectBase

Name Description

Public function Virtual Const

TStatId

 

GetStatId()

Return the stat id to use for this tickable

Public function Virtual Const

bool

 

IsTickable()

Virtual that can be overloaded by the inheriting class.

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

Pure virtual that must be overloaded by the inheriting class.

Classes

Name

Description

Public class

FOnMediaChanged

Gets an event delegate that is invoked when media has been opened or closed.