HTML and CSS Reference
In-Depth Information
*/
this.getFormat = function(){
return _format;
}
/**
* Sets the mimetype of the video source
* @param {app.type.format} format
*/
this.setFormat = function(format){
_format = format;
}
...
}
That concludes the VideoSource model. As you can see, it's very simple. Next,
you'll create the Video model, which is also relatively simple.
The Video Model
The Video model is also relatively simple, except that it has a composite
association with the VideoSource model in which it can be composed of many
video sources.
Create a new empty file called video.js within js/app/model . This will contain
the new video model.
The constructor accepts a title, length in milliseconds, and a URL to a
posterframe or preview frame, which will be an image.
var app = app || {};
app.model = app.model || {};
/**
* A video associated with a movie
* You must add video sources in order for videos to play
* @param {String} title
* @param {Integer} length
* @param {String} posterframe
*/
app.model.video = function appModelVideo(title, length, posterframe){
// Code implementation goes here
}
The instance variables for this object are title , length , posterframe , and an
array of sources. As you can see from the following code snippet, the sources
variable isn't part of the constructor's parameters.
 
Search WWH ::




Custom Search