Element.Media is a Mootools plugin that provides easier handling of media interaction via a JavaScript interface. This plugin works with both media elements, that means audio and video — given that your browser has support for these elements.
The Element.Media constructor accepts a selector-object (via $ or $$ etc), a string (assumes id-selector) or an Element object.
var media = new Element.Media('my_element_id')
There is an option to create the media element on the fly, if so, input selector/element will act as it's parent.
var media = new Element.Media('my_element_id', {
element: {
create: true,
type: 'video',
properties: {
id: 'cinemoo'
},
sources: [
{ url: 'feature_moovie.ogg', type: 'video/ogg' },
{ url: 'feature_moovie.m4v', type: 'video/mp4' }
]
}
});
Transcripts, in simple words, return data and/or fires an callback on a specified time in the media's playback. This gives a neat way to have (for example) subtitles to an video element, or add some interaction to your media.
var myTranscript = new Hash({
'00:00:01': 'Media playback started',
'00:00:10': {
text: 'Show some nifty diagram...',
callback: function() {
myDiagramObject.showDiagram(insertSumDataz);
}
}
});
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus