This repository was archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 106
JavaScript API
Sergey Radionov edited this page Jun 14, 2015
·
31 revisions
var wc = require("webchimera.js"); var vlcPlayer = wc.createPlayer();or
var wc = require("webchimera.js"); var vlcPlayer = wc.createPlayer(["-vvv"]);or
var wc = require("webchimera.js"); var vlcPlayer = new wc.VlcPlayer();or
var wc = require("webchimera.js"); var vlcPlayer = new wc.VlcPlayer(["-vvv"]);
Pixel format possible values:
-
RV32
: -
I420
:
-
NothingSpecial
: -
Opening
: -
Buffering
: -
Playing
: -
Paused
: -
Stopped
: -
Ended
: -
Error
:
-
playing
: -
length
: -
state
: returns current state.
-
pixelFormat
: -
position
: -
time
: -
volume
: -
mute
:
-
play( mrl )
: -
play()
: -
pause()
: -
togglePause()
: -
stop()
: -
toggleMute()
:
-
onFrameSetup( width, height, pixelFormat )
: -
onFrameReady( videoFrame )
: -
onFrameCleanup
: -
onMediaChanged
: -
onNothingSpecial
: vlc is in idle state doing nothing but waiting for a command to be issued. -
onOpening
: vlc is opening an media resource locator (MRL). -
onBuffering( percents )
: vlc is buffering. -
onPlaying
: vlc is playing a media. -
onPaused
: vlc is in paused state. -
onForward
: vlc is fastforwarding through the media (works only when an input supports forward playback). -
onBackward
: vlc is going backwards through the media (works only when an input supports backwards playback). -
onEncounteredError
: vlc has encountered an error and is unable to continue. -
onEndReached
: vlc has reached the end of current playlist. -
onStopped
: -
onTimeChanged( time )
: time has changed.time
is in milliseconds. -
onPositionChanged( position )
: media position has changed. -
onSeekableChanged( seekable )
: media seekable flag has changed. -
onPausableChanged( pausable )
: media pausable flag has changed. -
onLengthChanged( length )
:
-
.playlist
: Access playlist properties.
Mode possible values:
-
Normal
: play till last item. -
Loop
: infinite repeat all items. -
Single
: play current playlist item and stop.
-
itemCount
: number that returns the amount of items currently in the playlist. -
isPlaying
: a boolean that returns true if the current playlist item is playing and false when it is not playing.
-
currentItem
: returns current item index. -
mode
: playlist mode.
-
add(mrl) -> int
: add a playlist item. -
addWithOptions(mrl, options) -> int
: add a playlist item with options. -
play()
: start playing the current playlist item. -
playItem(i) -> bool
: start playing the item whose identifier is i. -
pause()
: -
togglePause()
: toggle the pause state for the current playlist item. -
stop()
: stop playing the current playlist item. -
next()
: iterate to the next playlist item. -
prev()
: iterate to the previous playlist item. -
clear()
: empty the current playlist, all items will be deleted from the playlist. -
removeItem(i) -> bool
: remove the item from playlist whose identifier is i. -
advanceItem(i, count)
: change item position within playlist.
Read only properties:
-
width
: -
height
: -
pixelFormat
: = RV32
Read only properties:
-
width
: -
height
: -
pixelFormat
: = I420 -
uOffset
: -
vOffset
: