forked from 0x2620/oxjs
use Ox.Log
This commit is contained in:
parent
92d25b6776
commit
dce2843303
50 changed files with 276 additions and 276 deletions
|
|
@ -21,7 +21,7 @@ Ox.VideoElement = function(options, self) {
|
|||
.options(options || {})
|
||||
.css({width: '100%', height: '100%'});
|
||||
|
||||
Ox.print('VIDEO ELEMENT OPTIONS', self.options)
|
||||
Ox.Log('Video', 'VIDEO ELEMENT OPTIONS', self.options)
|
||||
|
||||
self.items = [];
|
||||
self.paused = true;
|
||||
|
|
@ -37,7 +37,7 @@ Ox.VideoElement = function(options, self) {
|
|||
self.numberOfItems = items;
|
||||
self.numberOfPages = Math.ceil(self.numberOfItems / self.pageLength);
|
||||
loadPages(function() {
|
||||
Ox.print('VIDEO PAGES LOADED');
|
||||
Ox.Log('Video', 'VIDEO PAGES LOADED');
|
||||
setCurrentItem(0);
|
||||
if (!self.loadedMedatata) {
|
||||
self.loadedMetadata = true;
|
||||
|
|
@ -71,7 +71,7 @@ Ox.VideoElement = function(options, self) {
|
|||
}
|
||||
|
||||
function loadPage(page, callback) {
|
||||
Ox.print('VIDEO loadPage', page)
|
||||
Ox.Log('Video', 'VIDEO loadPage', page)
|
||||
//page = Ox.mod(page, self.numberOfPages);
|
||||
var loadedmetadata = 0,
|
||||
start = page * self.pageLength,
|
||||
|
|
@ -82,14 +82,14 @@ Ox.VideoElement = function(options, self) {
|
|||
data.forEach(function(data, i) {
|
||||
self.items[start + i] = loadItem(data.parts, data.points, function(item) {
|
||||
if (++loadedmetadata == pageLength) {
|
||||
Ox.print('VIDEO page', page, 'loaded')
|
||||
Ox.Log('Video', 'VIDEO page', page, 'loaded')
|
||||
callback && callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
Ox.print('PAGE IN CACHE')
|
||||
Ox.Log('Video', 'PAGE IN CACHE')
|
||||
callback && callback();
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ Ox.VideoElement = function(options, self) {
|
|||
item.offsets = Ox.range(item.parts).map(function(i) {
|
||||
return Ox.sum(Ox.sub(item.durations, 0, i));
|
||||
});
|
||||
//Ox.print('METADATA OF', src, 'LOADED', item)
|
||||
//Ox.Log('Video', 'METADATA OF', src, 'LOADED', item)
|
||||
if (self.isPlaylist) {
|
||||
callback && callback();
|
||||
} else {
|
||||
|
|
@ -202,7 +202,7 @@ Ox.VideoElement = function(options, self) {
|
|||
}
|
||||
|
||||
function setCurrentItem(item) {
|
||||
Ox.print('scI', item);
|
||||
Ox.Log('Video', 'scI', item);
|
||||
var interval;
|
||||
item = Ox.mod(item, self.numberOfItems);
|
||||
self.video && self.video.pause();
|
||||
|
|
@ -211,7 +211,7 @@ Ox.VideoElement = function(options, self) {
|
|||
} else {
|
||||
that.triggerEvent('seeking');
|
||||
interval = setInterval(function() {
|
||||
Ox.print('ITEM', item, 'NOT AVAILABLE');
|
||||
Ox.Log('Video', 'ITEM', item, 'NOT AVAILABLE');
|
||||
if (self.items[item]) {
|
||||
clearInterval(interval);
|
||||
that.triggerEvent('seeked');
|
||||
|
|
@ -233,7 +233,7 @@ Ox.VideoElement = function(options, self) {
|
|||
}
|
||||
|
||||
function setCurrentPart(part) {
|
||||
Ox.print('sCP', part);
|
||||
Ox.Log('Video', 'sCP', part);
|
||||
var css = {};
|
||||
['left', 'top', 'width', 'height'].forEach(function(key) {
|
||||
css[key] = self.$video.css(key);
|
||||
|
|
@ -247,11 +247,11 @@ Ox.VideoElement = function(options, self) {
|
|||
self.video = self.$video[0];
|
||||
!self.paused && self.video.play();
|
||||
self.currentPart = part;
|
||||
Ox.print('sCP', part, self.video.src)
|
||||
Ox.Log('Video', 'sCP', part, self.video.src)
|
||||
}
|
||||
|
||||
function setCurrentTime(time) {
|
||||
Ox.print('sCT', time);
|
||||
Ox.Log('Video', 'sCT', time);
|
||||
var currentPart, currentTime,
|
||||
item = self.items[self.currentItem];
|
||||
Ox.loop(item.parts - 1, -1, -1, function(i) {
|
||||
|
|
@ -261,7 +261,7 @@ Ox.VideoElement = function(options, self) {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
Ox.print('sCT', time, currentPart, currentTime);
|
||||
Ox.Log('Video', 'sCT', time, currentPart, currentTime);
|
||||
if (currentPart != self.currentPart) {
|
||||
setCurrentPart(currentPart);
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ Ox.VideoElement = function(options, self) {
|
|||
|
||||
function unloadPage(page) {
|
||||
//page = Ox.mod(page, self.numberOfPages);
|
||||
Ox.print('unloadPage', page)
|
||||
Ox.Log('Video', 'unloadPage', page)
|
||||
var start = page * self.pageLength,
|
||||
stop = Math.min(start + self.pageLength, self.numberOfItems);
|
||||
Ox.range(start, stop).forEach(function(i) {
|
||||
|
|
@ -337,7 +337,7 @@ Ox.VideoElement = function(options, self) {
|
|||
self.$video.css.apply(self.$video, arguments);
|
||||
} else {
|
||||
interval = setInterval(function() {
|
||||
Ox.print('VIDEO NOT YET AVAILABLE');
|
||||
Ox.Log('Video', 'VIDEO NOT YET AVAILABLE');
|
||||
if (self.$video) {
|
||||
clearInterval(interval);
|
||||
self.$video.css.apply(self.$video, arguments);
|
||||
|
|
@ -395,7 +395,7 @@ Ox.VideoElement = function(options, self) {
|
|||
playNext <f> play next
|
||||
@*/
|
||||
that.playNext = function() {
|
||||
Ox.print('PLAY NEXT')
|
||||
Ox.Log('Video', 'PLAY NEXT')
|
||||
setCurrentItem(self.currentItem + 1);
|
||||
self.video.play();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue