VideoRuntimeObject

VideoRuntimeObject

An object displaying a video on screen.

For the same video resource, only one video is being created in memory ( as a HTMLVideoElement). This means that two objects displaying the same video will have the same state for this video (paused/playing, current time, volume, etc...).

Constructor

new VideoRuntimeObject(runtimeScene, videoObjectData)

Parameters:
Name Type Description
runtimeScene

The scene the object belongs to.

videoObjectData

The data defining the object

Source:

Methods

extraInitializationFromInitialInstance(initialInstanceData)

Initialize the extra parameters that could be set for an instance.

Parameters:
Name Type Description
initialInstanceData

The initial instance data

Source:

getCurrentTime()

Get the current time of the video object.

Returns:
Type Description

The current time of the video

Source:

getDuration()

Return the total time of the video.

Returns:
Type Description

The duration of the video

Source:

getHeight()

Get the height of the video object.

Returns:
Type Description

The current height of the object

Source:

getOpacity()

Get object opacity.

Returns:
Type Description

The current opacity

Source:

getPlaybackSpeed()

Get the playback speed of the video object.

Returns:
Type Description

The current playback speed of the video.

Source:

getVolume()

Get the volume of the video object.

Returns:
Type Description

The current video's volume, betwenn 0 and 100.

Source:

getWidth()

Get the width of the video object.

Returns:
Type Description

The current width of the object

Source:

isEnded()

Check if the video has ended.

Returns:
Type Description

Has the video ended?

Source:

isLooped()

Check if the video is looping.

Returns:
Type Description

Is the video looping?

Source:

isMuted()

Return the state muted of video object.

Returns:
Type Description

Is the video muted?

Source:

isPaused()

Check if the video is paused.

Returns:
Type Description

Is the video being paused?

Source:

isPlayed()

Check if the video is being played.

Returns:
Type Description

Is the video being played?

Source:

mute(enable)

Set the state muted of the video.

Parameters:
Name Type Description
enable

The new state.

Source:

pause()

Pause the video.

Source:

play()

Play the video.

Source:

setAngle(angle)

Set the angle of the object.

Parameters:
Name Type Description
angle

The new angle of the object.

Source:

setCurrentTime(time)

Set the new time of the video object.

Parameters:
Name Type Description
time

The new time.

Source:

setHeight(height)

Set the height of the video.

Parameters:
Name Type Description
height

The new height in pixels.

Source:

setLoop(enable)

Set the state looped of the video.

Parameters:
Name Type Description
enable

true to loop the video

Source:

setOpacity(opacity)

Set object opacity.

Parameters:
Name Type Description
opacity

The new opacity of the object (0-255).

Source:

setPlaybackSpeed(playbackSpeed)

Set the new playback speed of the video object.

Parameters:
Name Type Description
playbackSpeed

The new playback speed.

Source:

setVolume(volume)

Set the volume of the video object.

Parameters:
Name Type Description
volume

The new volume, between 0 and 100.

Source:

setWidth(width)

Set the width of the video.

Parameters:
Name Type Description
width

The new width in pixels.

Source:

setX(x)

Set object position on X axis.

Parameters:
Name Type Description
x

The new position X of the object.

Source:

setY(y)

Set object position on Y axis.

Parameters:
Name Type Description
y

The new position Y of the object.

Source: