add some docstrings
This commit is contained in:
parent
204f083e98
commit
4768dcfe8e
5 changed files with 108 additions and 1 deletions
|
@ -1006,11 +1006,23 @@ Ox.VideoEditor = function(options, self) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
addAnnotation <f> add annotation
|
||||||
|
(layer, item) -> <o> add annotation to layer
|
||||||
|
layer <s> layer id
|
||||||
|
item <o> annotation to add
|
||||||
|
@*/
|
||||||
that.addAnnotation = function(layer, item) {
|
that.addAnnotation = function(layer, item) {
|
||||||
var i = Ox.getPositionById(self.options.layers, layer);
|
var i = Ox.getPositionById(self.options.layers, layer);
|
||||||
self.$annotationPanel[i].addItem(item);
|
self.$annotationPanel[i].addItem(item);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
removeAnnotations <f> add annotation
|
||||||
|
(layer, ids) -> <o> remove annotation from layer
|
||||||
|
layer <s> layer id
|
||||||
|
ids <a> array of item ids to remove
|
||||||
|
@*/
|
||||||
that.removeAnnotations = function(layer, ids) {
|
that.removeAnnotations = function(layer, ids) {
|
||||||
var i = Ox.getPositionById(self.options.layers, layer);
|
var i = Ox.getPositionById(self.options.layers, layer);
|
||||||
self.$annotationPanel[i].removeItems(ids);
|
self.$annotationPanel[i].removeItems(ids);
|
||||||
|
|
|
@ -386,37 +386,58 @@ Ox.VideoEditorPlayer = function(options, self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
mute <f> mute
|
||||||
|
@*/
|
||||||
that.mute = function() {
|
that.mute = function() {
|
||||||
self.$video.mute();
|
self.$video.mute();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
pause <f> pause
|
||||||
|
@*/
|
||||||
that.pause = function() {
|
that.pause = function() {
|
||||||
self.$video.pause();
|
self.$video.pause();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
play <f> play
|
||||||
|
@*/
|
||||||
that.play = function() {
|
that.play = function() {
|
||||||
self.$video.play();
|
self.$video.play();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
playInToOut <f> playInToOut
|
||||||
|
@*/
|
||||||
that.playInToOut = function() {
|
that.playInToOut = function() {
|
||||||
self.$video.paused() && self.$playButton.toggleTitle();
|
self.$video.paused() && self.$playButton.toggleTitle();
|
||||||
self.$video.playInToOut();
|
self.$video.playInToOut();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
toggleMute <f> toggleMute
|
||||||
|
@*/
|
||||||
that.toggleMute = function() {
|
that.toggleMute = function() {
|
||||||
self.$muteButton.trigger('click');
|
self.$muteButton.trigger('click');
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
togglePlay <f> togglePlay
|
||||||
|
@*/
|
||||||
that.togglePlay = function() {
|
that.togglePlay = function() {
|
||||||
self.$playButton.trigger('click');
|
self.$playButton.trigger('click');
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
unmute <f> unmute
|
||||||
|
@*/
|
||||||
that.unmute = function() {
|
that.unmute = function() {
|
||||||
self.$video.unmute();
|
self.$video.unmute();
|
||||||
return that;
|
return that;
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||||
|
|
||||||
|
/*@
|
||||||
|
Ox.VideoElement <f:Ox.Element> VideoElement Object
|
||||||
|
() -> <f> VideoElement Object
|
||||||
|
(options) -> <f> VideoElement Object
|
||||||
|
(options, self) -> <f> VideoElement Object
|
||||||
|
options <o> Options object
|
||||||
|
self <o> shared private variable
|
||||||
|
@*/
|
||||||
|
|
||||||
Ox.VideoElement = function(options, self) {
|
Ox.VideoElement = function(options, self) {
|
||||||
|
|
||||||
self = self || {};
|
self = self || {};
|
||||||
|
@ -267,15 +276,24 @@ Ox.VideoElement = function(options, self) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
animate <f> animate
|
||||||
|
@*/
|
||||||
that.animate = function() {
|
that.animate = function() {
|
||||||
self.$video.animate.apply(self.$video, arguments);
|
self.$video.animate.apply(self.$video, arguments);
|
||||||
return that;
|
return that;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
buffered <f> buffered
|
||||||
|
@*/
|
||||||
that.buffered = function() {
|
that.buffered = function() {
|
||||||
return self.video.buffered;
|
return self.video.buffered;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
currentTime <f> get/set currentTime
|
||||||
|
@*/
|
||||||
that.currentTime = function() {
|
that.currentTime = function() {
|
||||||
var ret;
|
var ret;
|
||||||
self.ended = false;
|
self.ended = false;
|
||||||
|
@ -288,6 +306,9 @@ Ox.VideoElement = function(options, self) {
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
css <f> css
|
||||||
|
@*/
|
||||||
that.css = function() {
|
that.css = function() {
|
||||||
var interval;
|
var interval;
|
||||||
if (self.$video) {
|
if (self.$video) {
|
||||||
|
@ -304,25 +325,40 @@ Ox.VideoElement = function(options, self) {
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
duration <f> duration
|
||||||
|
@*/
|
||||||
that.duration = function() {
|
that.duration = function() {
|
||||||
// 86399
|
// 86399
|
||||||
return self.items[self.currentItem].duration;
|
return self.items[self.currentItem].duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
muted <f> get/set muted
|
||||||
|
@*/
|
||||||
that.muted = function() {
|
that.muted = function() {
|
||||||
return getset('muted', arguments[0]);
|
return getset('muted', arguments[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
points <f> get points
|
||||||
|
@*/
|
||||||
that.points = function() {
|
that.points = function() {
|
||||||
return self.items[self.currentItem].points;
|
return self.items[self.currentItem].points;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
pause <f> pause
|
||||||
|
@*/
|
||||||
that.pause = function() {
|
that.pause = function() {
|
||||||
self.paused = true;
|
self.paused = true;
|
||||||
self.video.pause();
|
self.video.pause();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
play <f> play
|
||||||
|
@*/
|
||||||
that.play = function() {
|
that.play = function() {
|
||||||
if (self.ended) {
|
if (self.ended) {
|
||||||
that.currentTime(0);
|
that.currentTime(0);
|
||||||
|
@ -333,16 +369,25 @@ Ox.VideoElement = function(options, self) {
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
playNext <f> play next
|
||||||
|
@*/
|
||||||
that.playNext = function() {
|
that.playNext = function() {
|
||||||
Ox.print('PLAY NEXT')
|
Ox.print('PLAY NEXT')
|
||||||
setCurrentItem(self.currentItem + 1);
|
setCurrentItem(self.currentItem + 1);
|
||||||
self.video.play();
|
self.video.play();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
playPrevious <f> play previous
|
||||||
|
@*/
|
||||||
that.playPrevious = function() {
|
that.playPrevious = function() {
|
||||||
setCurrentItem(self.currentItem - 1);
|
setCurrentItem(self.currentItem - 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
src <f> get/set src
|
||||||
|
@*/
|
||||||
that.src = function() {
|
that.src = function() {
|
||||||
var ret;
|
var ret;
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
|
@ -360,14 +405,23 @@ Ox.VideoElement = function(options, self) {
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
videoHeight <f> get videoHeight
|
||||||
|
@*/
|
||||||
that.videoHeight = function() {
|
that.videoHeight = function() {
|
||||||
return self.video.videoHeight;
|
return self.video.videoHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
videoWidth <f> get videoWidth
|
||||||
|
@*/
|
||||||
that.videoWidth = function() {
|
that.videoWidth = function() {
|
||||||
return self.video.videoWidth;
|
return self.video.videoWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
volume <f> get/set volume
|
||||||
|
@*/
|
||||||
that.volume = function(value) {
|
that.volume = function(value) {
|
||||||
return getset('volume', arguments[0]);
|
return getset('volume', arguments[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,11 +260,19 @@ Ox.VideoPanelPlayer = function(options, self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
toggleAnnotations <f> toggle annotations
|
||||||
|
() -> <o> toggle visibility of annotations
|
||||||
|
@*/
|
||||||
that.toggleAnnotations = function() {
|
that.toggleAnnotations = function() {
|
||||||
that.$element.toggle(1);
|
that.$element.toggle(1);
|
||||||
//that.toggleAnnotations(null, !self.options.showAnnotations);
|
//that.toggleAnnotations(null, !self.options.showAnnotations);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
toggleControls <f> toggle controls
|
||||||
|
() -> <o> toggle visibility of controls
|
||||||
|
@*/
|
||||||
that.toggleControls = function() {
|
that.toggleControls = function() {
|
||||||
self.$panel.toggle(1);
|
self.$panel.toggle(1);
|
||||||
//that.toggleControls(null, !self.options.showControls);
|
//that.toggleControls(null, !self.options.showControls);
|
||||||
|
|
|
@ -2091,16 +2091,28 @@ Ox.VideoPlayer = function(options, self) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
playInToOut <f> play in to out
|
||||||
|
() -> <o> play in to out
|
||||||
|
@*/
|
||||||
that.playInToOut = function() {
|
that.playInToOut = function() {
|
||||||
playInToOut();
|
playInToOut();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
togglePaused <f> toggle paused state
|
||||||
|
() -> <o> toggle paused state
|
||||||
|
@*/
|
||||||
that.togglePaused = function() {
|
that.togglePaused = function() {
|
||||||
togglePaused();
|
togglePaused();
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
toggleMuted <f> toggle muted state
|
||||||
|
() -> <o> toggle muted state
|
||||||
|
@*/
|
||||||
that.toggleMuted = function() {
|
that.toggleMuted = function() {
|
||||||
toggleMuted();
|
toggleMuted();
|
||||||
return that;
|
return that;
|
||||||
|
|
Loading…
Reference in a new issue