class MMVideo
Class that represents a background video-file player.
Can be used as an image source.
class MMVideo
Name | Description |
---|---|
Constructors | |
MMVideo() | Creates a video-file player. |
Properties | |
looping | Whether loop the media when EOF met. |
width | Width of the image source. |
height | Height of the image source. |
isPlaying | Whether the media is currently being played. |
duration | Duration of the media in seconds. |
position | Playback position of the current media in seconds. |
Methods | |
dispose() | Dispose the unmanaged resource. |
updateTexture() | Attempt to read new frames and update the texture data. |
play() | Start playback of the media. |
pause() | Pause playback of the media. |
setPosition() | Apply seeking. |
setAudioDevice() | Change the audio-out device. |
Constructors
MMVideo()
MMVideo
(filename
: String, playAudio
: Boolean, idx_audio_dev
: Number, speed
: Number)
Creates a video-file player.
Parameters
filename
: url to local or http video source.
playAudio
: whether to play audio. Default true.
idx_audio_dev
: index of the audio-out device.
speed
: playback speed. Default 1.0.
Properties
looping
.looping
: Boolean
Whether loop the media when EOF met.
Readable and writable.
width
.width
: Number
Width of the image source.
Read-only.
height
.height
: Number
Height of the image source.
Read-only.
isPlaying
.isPlaying
: Boolean
Whether the media is currently being played.
Read-only.
duration
.duration
: Number
Duration of the media in seconds.
Read-only.
position
.position
: Number
Playback position of the current media in seconds.
Read-only.
Methods
dispose()
.dispose
(): undefined
Dispose the unmanaged resource.
updateTexture()
.updateTexture
(): undefined
Attempt to read new frames and update the texture data.
play()
.play
(): undefined
Start playback of the media.
pause()
.pause
(): undefined
Pause playback of the media.
setPosition()
setPosition
(position
: Number): undefined
Apply seeking, set the current position (in secs) to position
.
setAudioDevice()
.setAudioDevice
(idx_audio_dev
: Number): undefined
Change the audio-out device.