forked from 0x2620/oxjs
add some docstrings
This commit is contained in:
parent
204f083e98
commit
4768dcfe8e
5 changed files with 108 additions and 1 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue