VideoBase: base for implementing a video reader

_REF

VideoBase: base for implementing a video reader

class pymt.core.video.VideoBase(**kwargs)

Bases: pymt.event.EventDispatcher

VideoBase, a class to implement a video reader.

Warning

For this object, you need to call update() yourself to let the engine update the video texture before calling draw().

Parameters :
filename : str

Filename of the video. Can be a file or an URI.

color : list

Color filter of the video (usually white.)

eos : str, default to ‘pause’

Action to do when EOS is hit. Can be one of ‘pause’ or ‘loop’

async : bool, default to True

Asynchronous loading (may be not supported by all providers)

autoplay : bool, default to False

Auto play the video at init

Events :
on_eos

Fired when EOS is hit

draw()

Draw the current video on screen

duration

Get the video duration (in seconds)

filename

Get/set the filename/uri of current video

load()

Load the video from the current filename

play()

Play the video

position

Get/set the position in the video (in seconds)

seek(percent)

Move on percent position

state

Get the video playing status

stop()

Stop the video playing

texture

Get the video texture

unload()

Unload the actual video

update()

Update the video content to texture. Must be called every frame, before draw.

volume

Get/set the volume in the video (1.0 = 100%)

Previous topic

MarkupLabel: Handle drawing of text with markup

Next topic

Graphics: all low level function to draw object in OpenGL.

This Page