Controlling the video playback
There are a number of additional functions in ofVideoPlayer
for controlling video playing and positioning:
The
stop()
function is used to stop playing the video.The
setPaused( bPause )
function sets/resets pause of video playing, wherebPause
has typebool
. If you pause the video, you can still switch its frames using thesetFrame()
orsetPosition()
function. It is extremely useful for the exact frame number control.The
setPosition( pos )
function sets playing position in file, wherepos
is a float number in range[0, 1]
.The
setFrame( frame )
function sets current frame toframe
, whereframe
is an integer value from0
tovideo. getTotalNumFrames() - 1
.The
getCurrentFrame()
function returns current frame number.The
getTotalNumFrames()
function returns number of frames in video.The
getDuration()
function returns internal duration of video in seconds as a float number.The
isLoaded()
function returnstrue
if video is successfully loaded, this can be used for handling...