- Download Adobe Flex SDK.
- Extract it to some location.
- In
Locomote
folder, runFLEX_HOME=<path to flex> make
. Player.swf
should now be available in thebuild
folder.
NB: This API is only a draft, and parts of it are not implemented. Do not use this yet.
Starts playing video from url. Protocol is determined by url.
Example: rtsp://server:port/stream
.
Supported protocols:
rtsp
- RTSP over TCPrtsph
- RTSP over HTTPrtmp
- RTMPrtmpt
- RTMP over HTTPrtmps
- RTMP over SSLhttp
- Progressive download via HTTP
Stops video stream.
Pauses video stream.
Resumes video from paused state.
Seeks to timestamp
ms from start of stream.
The current stream state is preserved - paused or playing.
Fast forward video stream with playback speed multiplied with speed
.
Returns a status object with the following data:
- fps - frames per second.
- resolution (object) - the stream size
{ width, height }
. - playback speed - current playback speed. 1.0 is normal stream speed.
- current time - ms from start of stream.
- protocol - which high-level transport protocol is in use.
- audio (bool) - if the stream contains audio.
- video (bool) - if the stream contains video.
- state - current playback state (playing, paused, stopped).
- isSeekable (bool) - if it is possible to seek in the stream.
- isPlaybackSpeedChangeable (bool) - if the playback speed can be altered.
- streamURL - the source of the current media.
Returns a status object with the following data:
- microphoneVolume - the volume of the microphone when capturing audio
- speakerVolume - the volume of the speakers (i.e. the stream volume).
- microphoneMuted (bool) - if the microphone is muted.
- speakerMuted (bool) - if the speakers are muted.
- fullScreen (bool) - if the player is currently in fullscreen mode.
Sets speaker volume from 0-100. The default value is 50.
Mutes the speaker volume. Remembers the current volume and resets to it if the speakers are unmuted.
Resets the volume to previous unmuted value.
Sets microphone volume from 0-100. The default value is 50.
Mutes the microphone. Remembers the current volume and resets to it if the microphone is unmuted.
Resets the volume to previous unmuted value.
Starts transmitting microphone input to the camera speaker. The optional type
parameter can be used for future implementations of other protocols, currently only the Axis audio transmit api is supported. For Axis cameras the url
parameter should be in the format - http://server:port/axis-cgi/audio/transmit.cgi
.
Stops transmitting microphone input to the camera speaker.
Sets configuration values of the player. config
is a JavaScript object that can have the following optional values:
buffer
- The number of seconds that should be buffered. The default value is1
.scaleUp
- Specifies if the video can be scaled up or not. The default value isfalse
.allowFullscreen
- Specifices if fullscreen mode is allowed or not. The default value istrue
.
Starts listening for events with eventName
. Calls callback
when event triggers.
Stops listening for events with eventName. Calls callback
when event triggers.
Dispatched when video streams starts.
Dispatched when stream stops.
Dispatched when video stream fails. error
can be either
protocol error (rtsp etc) or Locomote internal error.
Includes socket and seek errors.error
is a generic object.
Dispatched when video stream is paused. reason
can have the following values:
user
- stream was paused by user.buffering
- stream has stopped for buffering.
Dispatched when stream playing is resumed after pause.
Dispatched when seek has completed.
Dispatched when fixed length video stream reaches end of stream.
Dispatched when the player enters fullscreen mode.
Dispatched when the player exits fullscreen mode.