add some docstrings

This commit is contained in:
j 2011-09-14 10:34:33 -04:00
parent 204f083e98
commit 4768dcfe8e
5 changed files with 108 additions and 1 deletions

View file

@ -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) {
var i = Ox.getPositionById(self.options.layers, layer);
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) {
var i = Ox.getPositionById(self.options.layers, layer);
self.$annotationPanel[i].removeItems(ids);

View file

@ -386,37 +386,58 @@ Ox.VideoEditorPlayer = function(options, self) {
}
}
/*@
mute <f> mute
@*/
that.mute = function() {
self.$video.mute();
return that;
};
/*@
pause <f> pause
@*/
that.pause = function() {
self.$video.pause();
return that;
};
/*@
play <f> play
@*/
that.play = function() {
self.$video.play();
return that;
};
/*@
playInToOut <f> playInToOut
@*/
that.playInToOut = function() {
self.$video.paused() && self.$playButton.toggleTitle();
self.$video.playInToOut();
return that;
};
/*@
toggleMute <f> toggleMute
@*/
that.toggleMute = function() {
self.$muteButton.trigger('click');
return that;
}
/*@
togglePlay <f> togglePlay
@*/
that.togglePlay = function() {
self.$playButton.trigger('click');
return that;
}
/*@
unmute <f> unmute
@*/
that.unmute = function() {
self.$video.unmute();
return that;

View file

@ -1,5 +1,14 @@
// 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) {
self = self || {};
@ -267,15 +276,24 @@ Ox.VideoElement = function(options, self) {
});
}
/*@
animate <f> animate
@*/
that.animate = function() {
self.$video.animate.apply(self.$video, arguments);
return that;
}
};
/*@
buffered <f> buffered
@*/
that.buffered = function() {
return self.video.buffered;
};
/*@
currentTime <f> get/set currentTime
@*/
that.currentTime = function() {
var ret;
self.ended = false;
@ -288,6 +306,9 @@ Ox.VideoElement = function(options, self) {
return ret;
};
/*@
css <f> css
@*/
that.css = function() {
var interval;
if (self.$video) {
@ -304,25 +325,40 @@ Ox.VideoElement = function(options, self) {
return that;
};
/*@
duration <f> duration
@*/
that.duration = function() {
// 86399
return self.items[self.currentItem].duration;
};
/*@
muted <f> get/set muted
@*/
that.muted = function() {
return getset('muted', arguments[0]);
};
/*@
points <f> get points
@*/
that.points = function() {
return self.items[self.currentItem].points;
};
/*@
pause <f> pause
@*/
that.pause = function() {
self.paused = true;
self.video.pause();
return that;
};
/*@
play <f> play
@*/
that.play = function() {
if (self.ended) {
that.currentTime(0);
@ -333,16 +369,25 @@ Ox.VideoElement = function(options, self) {
return that;
};
/*@
playNext <f> play next
@*/
that.playNext = function() {
Ox.print('PLAY NEXT')
setCurrentItem(self.currentItem + 1);
self.video.play();
};
/*@
playPrevious <f> play previous
@*/
that.playPrevious = function() {
setCurrentItem(self.currentItem - 1);
};
/*@
src <f> get/set src
@*/
that.src = function() {
var ret;
if (arguments.length == 0) {
@ -360,14 +405,23 @@ Ox.VideoElement = function(options, self) {
return ret;
};
/*@
videoHeight <f> get videoHeight
@*/
that.videoHeight = function() {
return self.video.videoHeight;
};
/*@
videoWidth <f> get videoWidth
@*/
that.videoWidth = function() {
return self.video.videoWidth;
};
/*@
volume <f> get/set volume
@*/
that.volume = function(value) {
return getset('volume', arguments[0]);
}

View file

@ -260,11 +260,19 @@ Ox.VideoPanelPlayer = function(options, self) {
}
}
/*@
toggleAnnotations <f> toggle annotations
() -> <o> toggle visibility of annotations
@*/
that.toggleAnnotations = function() {
that.$element.toggle(1);
//that.toggleAnnotations(null, !self.options.showAnnotations);
};
/*@
toggleControls <f> toggle controls
() -> <o> toggle visibility of controls
@*/
that.toggleControls = function() {
self.$panel.toggle(1);
//that.toggleControls(null, !self.options.showControls);

View file

@ -2091,16 +2091,28 @@ Ox.VideoPlayer = function(options, self) {
}
};
/*@
playInToOut <f> play in to out
() -> <o> play in to out
@*/
that.playInToOut = function() {
playInToOut();
return that;
};
/*@
togglePaused <f> toggle paused state
() -> <o> toggle paused state
@*/
that.togglePaused = function() {
togglePaused();
return that;
}
/*@
toggleMuted <f> toggle muted state
() -> <o> toggle muted state
@*/
that.toggleMuted = function() {
toggleMuted();
return that;