Class: SC.VideoView


Extends SC.View.

Renders a videoView using different technologies like HTML5 video tag, quicktime and flash.

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

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 video in a video 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: video.js

Since:
SproutCore 1.1

Field Summary

Class Methods

Instance Methods

Field Detail

canPlay Boolean
Indicates if the video is ready to be played.
captionsEnabled Boolean
Flag to enable captions if available.
classNames String
Video 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 video url changed.

duration Number
Duration in secs
ended Boolean
Indicates if the video has reached the end
SC.VideoView.flashViews
Hash to store references to the different flash videos.
loaded Boolean
Tells you if the video is loaded.
paused Boolean
Tells you if the video is paused or not.
videoHeight Number
Width of the video in pixels.
videoObject Object
Reference to the video object once is created.
videoWidth Number
Width of the video in pixels.
volume Number
Volume. The value should be between 0 and 1

Class Method Detail

addToVideoFlashViews(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

addQTDOMEvents()
Adds all the necessary quicktime DOM elements.
Returns:
void
addVideoDOMEvents()
Adds all the necessary video DOM elements.
Returns:
void
closedCaption()
Enables captions if available
Returns:
void
currentTime(key, value)
Current time in secs
Parameters:
key
value
didAppendToDocument()
didCreateLayer()
In didCreateLayer we add DOM events for video tag or quicktime.
Returns:
void
frameDidChange()

This function is called everytime the frame changes. This is done to get the right video dimensions for HTML5 video tag.

Returns:
void
fullScreen()
Goes into fullscreen mode if available
Returns:
void
play()
Calls the right play method depending on the technology.
Returns:
void
playPause()
Plays or stops the video.
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 video.
Returns:
void
stop()
Calls the right stop method depending on the technology.
Returns:
void
time()
Formatted currentTime. (00:00)
updateQTVideoObjectLoadedTimeRanges(vid)
Parameters:
vid
updateVideoElementLoadedTimeRanges(videoElem)
Parameters:
videoElem
valueObserver()
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)