<mediastream>
Allows video playback.

JavaScript: lz.mediastream
extends <node> » lz.Eventable »

<mediastream> allows applications to stream video from HTTP or RTMP servers. Classes like <videoview> use mediastreams to handle the connection to the server.

<canvas>
          <mediastream name="ms" autoplay="true" type="http" url="http://www.archive.org/download//JudgeMediaTestVideoFile_0/video.flv"/>
          <videoview type="http" autoplay="true" width="320" height="240" stream="canvas.ms"/>
        </canvas>
edit

Attributes

Name Type (tag) Type (js) Default Category
autoplay boolean Boolean false read/write
  If true, video will start playing as soon as url is set. Default: false.
autoplayLength expression String 'end' read/write
  Autoplay length argument passed to mediastream.play(). See the mediastream.play documentation for its values. Default: 'end'.
autoplayPause boolean Boolean false read/write
  Autoplay pause argument passed to mediastream.play(). See the mediastream.play documentation for its values. Default: false.
autoplayReset expression Boolean true read/write
  Autoplay reset argument passed to mediastream.play(). See the mediastream.play documentation for its values. Default: true.
autoplayStart expression String 'either' read/write
  Autoplay start argument passed to mediastream.play(). See the mediastream.play documentation for its values. Default: 'either'.
broadcasting expression Boolean (this.mode == 'broadcasting') || (this.mode == 'recording') readonly
  True if broadcasting right now.
cam expression lz.camera null readonly
  A reference to the camera. This must be set if broadcasting. This is set automatically if the stream is a child of a videoview.
debug expression Boolean false read/write
  When true, print extra info to the debugger.
fps number Number 0 read/write
  The current frames per second for playing video.
mic expression lz.microphone null readonly
  A reference to the microphone. This must be set if broadcasting. This is set automatically if the stream is a child of a videoview.
mode string String   read/write
  Mode: "" if doing nothing, "playing" if playing, "broadcasting" if can be received, "recording" if recording. Recording also implies can be received, i.e., broadcasting. Pausing does not affect the mode, unlike stopping.
muteaudio expression Boolean false readonly
  True iff audio is muted.
mutevideo expression Boolean false readonly
  True iff video is muted.
paused expression Boolean false read/write
  True to pause playback. Named this way to pun with paused for animators.
playing expression Boolean (this.mode == 'playing') && (!this['paused']) readonly
  True if playing right now.
progress number Number 0 read/write
  Progress of mediastream currently downloading. (from 0 for none to 1 for all).
recording expression Boolean this.mode == 'recording' readonly
  True if recording right now.
rtmp expression lz.rtmpconnection null read/write
  The rtmp to use (defaults to the first one created).
streamname string String   read/write
  The rtmp streamname (without .flv suffix).
time number Number 0 read/write
  Current time of mediastream currently playing or recording (in seconds)
totaltime number Number 0 read/write
  Total length (in seconds) of mediastream currently playing.
type string String http read/write
  Protocol "rtmp" or "http" (default: "http").
url string String   read/write
  The url of the mediastream, maybe be relative URL, for example: http://localhost/myvideo.flv, or simply myvideo.flv when type="rtmp" the url is always relative to the rtmpconnection.

Methods

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
oncuepoint Event sent when a cue point occurs, whose parameter is a dictionary of metadata.
oninsufficientbandwidth Event sent when insufficient bandwidth.
onmetadata Event sent when metadata is received, whose parameter is a dictionary of metadata.
onmode Event sent when mode is changed.
onstart Event sent when playing or recording starts.
onstop Event sent when playing or recording stops.
ontype Event sent when type changes.
onurl Event sent when url changes.

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy