Class: SC.AudioView


Extends SC.View.

Renders a audioView using different technologies like HTML5 audio tag, quicktime and flash.

This view wraps the different technologies so you can use one standard and simple API to play audio.

You can specify and array with the order of how the technologies will degrade depending on availability. For example you can set degradeList to be ['html5', 'flash'] and it will load your audio in an audio tag if the technology is available otherwise flash and if neither of the technologies are available it will show a message saying that your machine needs to install one of this technologies.

Defined in: audio.js

Since:
SproutCore 1.1

Field Summary

Class Methods

Instance Methods

Field Detail

audioObject Object
Reference to the audio object once is created.
canPlay Boolean
Indicates if the audio is ready to be played.
classNames String
Audio view className.
degradeList Array

Array containing the technologies and the order to load them depending availability

displayProperties Array

Properties that trigger a re render of the view. If the value changes, it means that the audio url changed.

duration Number
Duration in secs
ended Boolean
Indicates if the audio has reached the end
SC.AudioView.flashViews
Hash to store references to the different flash audios.
loaded Boolean
Tells you if the audio is loaded.
paused Boolean
Tells you if the audio is paused or not.
volume Number
Volume. The value should be between 0 and 1

Class Method Detail

addToAudioFlashViews(view)
Adds the flash view to the flashViews hash.
Parameters:
view
logFlash(message)
Function to log events coming from flash.
Parameters:
message
updateProperty(scid, property, value)

This function is called from flash to update the properties of the corresponding flash view.

Parameters:
scid
property
value

Instance Method Detail

addAudioDOMEvents()
Adds all the necessary audio DOM elements.
Returns:
void
addQTDOMEvents()
Adds all the necessary quicktime DOM elements.
Returns:
void
closedCaption()
Enables captions if available
Returns:
void
currentTime(key, value)
The current play time in seconds.
Parameters:
key
value
didAppendToDocument()
didCreateLayer()
In didCreateLayer we add DOM events for audio tag or quicktime.
Returns:
void
play()
Calls the right play method depending on the technology.
Returns:
void
playPause()
Plays or stops the audio.
Returns:
void
render(context, firstTime)
Renders the appropriate HTML according for the technology to use.
Parameters:
context SC.RenderContext
the render context
firstTime Boolean
YES if this is creating a layer
Returns:
void
seek()

Called when currentTime changes. Notifies the different technologies then new currentTime.

Returns:
void
setVolume()
Set the volume of the audio.
Returns:
void
stop()
Calls the right stop method depending on the technology.
Returns:
void
time()
Formatted currentTime. (00:00)
valueObserver()
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)