dojox/av/_Media (version 1.10)

Summary

Used as a mixin for dojox and AIR media

Calculates the current status of the playing media and fires the appropriate events.

See the dojox/av/_Media reference documentation for more information.

Property Summary

  • _flashObjectThe dojox.embed object
  • allowFullScreenWhether to allow the SWF to go to fullscreen
  • allowNetworkingWhether SWF is restricted to a domain
  • allowScriptAccessWhether the SWF can access the container JS
  • autoPlayWhether the video automatically plays on load or not.
  • bufferTimeTime in milliseconds that the video should be loaded before it will play.
  • flashMediaThe SWF object.
  • idThe id of this widget and the id of the SWF movie.
  • initialVolumeThe initial volume setting of the player.
  • isDebugSetting to true tells the SWF to output log messages to Firebug.
  • mediaUrl
  • minBufferTimeTime in milliseconds between the playhead time and loaded time that will trigger the buffer.
  • percentDownloadedThe percentage the media has downloaded; from 0-100
  • updateTimeHow often, in milliseconds to get an update of the video position.
  • wmodeThe render type of the SWF

Method Summary

  • _eventFactory() Creates a generic event object.
  • _figureStatus() Calculate media status, based on playhead movement, and onStop and onStart events
  • _initStatus() Connect mediaStatus to the media.
  • _normalizeUrl(_url) Checks that path is relative to HTML file or converts it to an absolute path.
  • _normalizeVolume(vol) Ensures volume is less than one
  • _sub(topic,method) helper for subscribing to topics
  • destroy() destroys flash
  • getTime() Returns the current time of the video

Event Summary

  • onBuffer(isBuffering) Fires a boolean to tell if media is paused for buffering or if buffering has finished
  • onClick(evt) Fires when the player is clicked Could be used to toggle play/pause, or do an external activity, like opening a new window.
  • onDownloaded(percent) Fires the amount of that the media has been downloaded.
  • onEnd(data) Fires when video ends Could be used to change pause button to play or show a post video graphic, like YouTube
  • onError(data,url) Fired when the player encounters an error
  • onLoad(mov) Fired when the SWF player has loaded NOT when the video has loaded
  • onMetaData(data,evt) The video properties.
  • onPause(data) Fires when the pause button is clicked
  • onPlay(data) Fires when video starts and resumes
  • onPlayerStatus(data) The status of the video from the SWF playing, stopped, bufering, etc.
  • onPosition(time) The position of the playhead in seconds
  • onResize()
  • onStart(data) Fires when video starts Good for setting the play button to pause during an autoPlay for example
  • onStatus(data) Simple status
  • onStop() Fire when the Stop button is clicked
  • onSwfSized(data) Fired on SWF resize, or when its toggled between fullscreen.

Properties

_flashObject
Defined by: dojox/av/_Media

The dojox.embed object

allowFullScreen
Defined by: dojox/av/_Media

Whether to allow the SWF to go to fullscreen

allowNetworking
Defined by: dojox/av/_Media

Whether SWF is restricted to a domain

allowScriptAccess
Defined by: dojox/av/_Media

Whether the SWF can access the container JS

autoPlay
Defined by: dojox/av/_Media

Whether the video automatically plays on load or not.

bufferTime
Defined by: dojox/av/_Media

Time in milliseconds that the video should be loaded before it will play. May pause and resume to build up buffer. Prevents stuttering.

Note: Older FLVs, without a duration, cannot be buffered.

flashMedia
Defined by: dojox/av/_Media

The SWF object. Methods are passed to this.

id
Defined by: dojox/av/_Media

The id of this widget and the id of the SWF movie.

initialVolume
Defined by: dojox/av/_Media

The initial volume setting of the player. Acccepts between 0 and 1.

isDebug
Defined by: dojox/av/_Media

Setting to true tells the SWF to output log messages to Firebug.

mediaUrl
Defined by: dojox/av/_Media
minBufferTime
Defined by: dojox/av/_Media

Time in milliseconds between the playhead time and loaded time that will trigger the buffer. When buffer is triggered, video will pause until the bufferTime amount is buffered. Note: Should be a small number, greater than zero.

percentDownloaded
Defined by: dojox/av/_Media

The percentage the media has downloaded; from 0-100

updateTime
Defined by: dojox/av/_Media

How often, in milliseconds to get an update of the video position.

wmode
Defined by: dojox/av/_Media

The render type of the SWF

Methods

_eventFactory()
Defined by dojox/av/_Media

Creates a generic event object.

Returns:object
_figureStatus()
Defined by dojox/av/_Media

Calculate media status, based on playhead movement, and onStop and onStart events

_initStatus()
Defined by dojox/av/_Media

Connect mediaStatus to the media.

_normalizeUrl(_url)
Defined by dojox/av/_Media

Checks that path is relative to HTML file or converts it to an absolute path.

Parameter Type Description
_url undefined
Returns:string
_normalizeVolume(vol)
Defined by dojox/av/_Media

Ensures volume is less than one

Parameter Type Description
vol number
Returns:number
_sub(topic,method)
Defined by dojox/av/_Media

helper for subscribing to topics

Parameter Type Description
topic undefined
method undefined
destroy()
Defined by dojox/av/_Media

destroys flash

getTime()
Defined by dojox/av/_Media

Returns the current time of the video

Returns:undefined

Events

onBuffer(isBuffering)
Defined by: dojox/av/_Media

Fires a boolean to tell if media is paused for buffering or if buffering has finished

Parameter Type Description
isBuffering Boolean
onClick(evt)
Defined by: dojox/av/_Media

Fires when the player is clicked Could be used to toggle play/pause, or do an external activity, like opening a new window.

Parameter Type Description
evt Object
onDownloaded(percent)
Defined by: dojox/av/_Media

Fires the amount of that the media has been downloaded. Number, 0-100

Parameter Type Description
percent Number
onEnd(data)
Defined by: dojox/av/_Media

Fires when video ends Could be used to change pause button to play or show a post video graphic, like YouTube

Parameter Type Description
data Object
onError(data,url)
Defined by: dojox/av/_Media

Fired when the player encounters an error

Parameter Type Description
data Object
url String

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onLoad(mov)
Defined by: dojox/av/_Media

Fired when the SWF player has loaded NOT when the video has loaded

Parameter Type Description
mov SWF

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onMetaData(data,evt)
Defined by: dojox/av/_Media

The video properties. Width, height, duration, etc.

Parameter Type Description
data Object
evt Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onPause(data)
Defined by: dojox/av/_Media

Fires when the pause button is clicked

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onPlay(data)
Defined by: dojox/av/_Media

Fires when video starts and resumes

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onPlayerStatus(data)
Defined by: dojox/av/_Media

The status of the video from the SWF playing, stopped, bufering, etc.

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onPosition(time)
Defined by: dojox/av/_Media

The position of the playhead in seconds

Parameter Type Description
time Float

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onResize()
Defined by: dojox/av/_Media

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onStart(data)
Defined by: dojox/av/_Media

Fires when video starts Good for setting the play button to pause during an autoPlay for example

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onStatus(data)
Defined by: dojox/av/_Media

Simple status

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onStop()
Defined by: dojox/av/_Media

Fire when the Stop button is clicked

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
onSwfSized(data)
Defined by: dojox/av/_Media

Fired on SWF resize, or when its toggled between fullscreen.

Parameter Type Description
data Object

Examples

Example 1

console.warn("ERROR-"+data.type.toUpperCase()+":",
      data.info.code, " - URL:", url);
Error in the documentation? Can’t find what you are looking for? Let us know!