# datastream

A streaming media handle, typically for MPEG video. Freed automatically.


### time() <sub>function</sub>

Return the current playback time in seconds.



**Returns**: Current time as a float in seconds.


### seek(seconds) <sub>function</sub>

Seek to the specified time (in seconds).



**seconds**: The time to jump to in the stream.


**Returns**: None


### advance(seconds) <sub>function</sub>

Advance by a certain number of seconds, decoding video as needed.



**seconds**: The amount of time to skip forward.


**Returns**: None


### duration() <sub>function</sub>

Return the total duration of the video stream, in seconds, if known.



**Returns**: Float seconds duration, or 0 if unknown.


### framerate() <sub>function</sub>

Return the framerate (FPS) of the stream if known.



**Returns**: Float frames per second, or 0 if unknown.


### callback <sub>accessor</sub>

A function to call whenever a new frame is decoded. If not set, no callback is invoked.



**fn**: (when setting) A function that receives (surface).


**Returns**: The existing function or undefined if none.

