love.graphics.newVideo

Available since LÖVE 0.10.0
This function is not supported in earlier versions.

Creates a new drawable Video. Currently only Ogg Theora video files are supported.

O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!  



Function

Synopsis

video = love.graphics.newVideo( filename )

Arguments

string filename
The file path to the Ogg Theora video file.

Returns

Video video
A new Video.

Function

Synopsis

video = love.graphics.newVideo( videostream )

Arguments

VideoStream videostream
A video stream object.

Returns

Video video
A new Video.

Examples

Load and play a video.

function love.load()
    video = love.graphics.newVideo("myvideo.ogv")
    video:play()
end

function love.draw()
    love.graphics.draw(video, 0, 0)
end

See Also


Other Languages