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
|
|
@ -240,9 +240,9 @@ Ox.BlockTimeline = function(options, self) {
|
|||
})
|
||||
.load(function() {
|
||||
context.drawImage($img[0], i * 3600, 0);
|
||||
//Ox.print('loaded, images', loaded, images, $img[0])
|
||||
//Ox.Log('Video', 'loaded, images', loaded, images, $img[0])
|
||||
if (++loaded == images) {
|
||||
//Ox.print('callback', canvas.toDataURL().length)
|
||||
//Ox.Log('Video', 'callback', canvas.toDataURL().length)
|
||||
callback(canvas.toDataURL());
|
||||
}
|
||||
});
|
||||
|
|
@ -356,9 +356,9 @@ Ox.BlockTimeline = function(options, self) {
|
|||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
//Ox.print('onChange:', key, value)
|
||||
//Ox.Log('Video', 'onChange:', key, value)
|
||||
if (key == 'points') {
|
||||
//Ox.print('key', key, 'value', value)
|
||||
//Ox.Log('Video', 'key', key, 'value', value)
|
||||
setMarkerPoint(0);
|
||||
setMarkerPoint(1);
|
||||
updateSelection();
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ Ox.BlockVideoTimeline = function(options, self) {
|
|||
// fixme: check if this pattern is better
|
||||
// than the one used for list selection
|
||||
if (!self.triggered) {
|
||||
Ox.print('trigger............')
|
||||
Ox.Log('Video', 'trigger............')
|
||||
that.triggerEvent('position', {
|
||||
position: self.options.position
|
||||
});
|
||||
|
|
|
|||
|
|
@ -186,9 +186,9 @@ Ox.SmallTimeline = function(options, self) {
|
|||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
//Ox.print('onChange:', key, value)
|
||||
//Ox.Log('Video', 'onChange:', key, value)
|
||||
if (key == 'points') {
|
||||
//Ox.print('key', key, 'value', value)
|
||||
//Ox.Log('Video', 'key', key, 'value', value)
|
||||
setMarkerPoint(0);
|
||||
setMarkerPoint(1);
|
||||
} else if (key == 'position') {
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
|
||||
self.resolutions = [];
|
||||
Ox.forEach(self.options.video, function(url, resolution) {
|
||||
Ox.print(url, resolution)
|
||||
Ox.Log('Video', url, resolution)
|
||||
self.resolutions.push(
|
||||
{id: resolution + '', title: resolution + 'p'}
|
||||
);
|
||||
|
|
@ -769,7 +769,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
}
|
||||
|
||||
function getSizes(scrollbarIsVisible) {
|
||||
//Ox.print('getSizes', scrollbarIsVisible)
|
||||
//Ox.Log('Video', 'getSizes', scrollbarIsVisible)
|
||||
var scrollbarWidth = Ox.UI.SCROLLBAR_SIZE,
|
||||
contentWidth = self.options.width
|
||||
- (self.options.showAnnotations * self.options.annotationsSize) - 1
|
||||
|
|
@ -829,7 +829,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
self.$editor.css({
|
||||
overflowY: (scrollbarIsVisible && height <= self.options.height - 16) ? 'scroll' : 'auto'
|
||||
});
|
||||
//Ox.print('getSizes', scrollbarIsVisible, height, self.options.height, size)
|
||||
//Ox.Log('Video', 'getSizes', scrollbarIsVisible, height, self.options.height, size)
|
||||
return (!scrollbarIsVisible && height > self.options.height - 16) ? getSizes(true) : size;
|
||||
function getHeight() {
|
||||
return size.player[0].height + self.controlsHeight +
|
||||
|
|
@ -1022,7 +1022,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'width' || key == 'height') {
|
||||
Ox.print('XXXX setSizes', key, value, self.options.width, self.options.height)
|
||||
Ox.Log('Video', 'XXXX setSizes', key, value, self.options.width, self.options.height)
|
||||
setSizes();
|
||||
} else if (key == 'position') {
|
||||
setPosition(value);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
.options(options || {})
|
||||
.addClass('OxVideoPlayer');
|
||||
|
||||
Ox.print('VIDEO PLAYER OPTIONS', self.options)
|
||||
Ox.Log('Video', 'VIDEO PLAYER OPTIONS', self.options)
|
||||
|
||||
Ox.UI.$window.bind({
|
||||
resize: function() {
|
||||
|
|
@ -252,12 +252,12 @@ Ox.VideoPlayer = function(options, self) {
|
|||
mouseenter: function() {
|
||||
showControls();
|
||||
self.mouseHasLeft = false;
|
||||
//Ox.print('MOUSE HAS ENTERED')
|
||||
//Ox.Log('Video', 'MOUSE HAS ENTERED')
|
||||
},
|
||||
mouseleave: function() {
|
||||
hideControls();
|
||||
self.mouseHasLeft = true;
|
||||
//Ox.print('MOUSE HAS LEFT')
|
||||
//Ox.Log('Video', 'MOUSE HAS LEFT')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1228,13 +1228,13 @@ Ox.VideoPlayer = function(options, self) {
|
|||
function getPosition(e) {
|
||||
// fixme: no offsetX in firefox???
|
||||
if ($.browser.mozilla) {
|
||||
//Ox.print(e, e.layerX - 56)
|
||||
//Ox.Log('Video', e, e.layerX - 56)
|
||||
return Ox.limit(
|
||||
(e.layerX - 48 - self.barHeight / 2) / self.timelineImageWidth * self.$video.duration(),
|
||||
0, self.$video.duration()
|
||||
);
|
||||
} else {
|
||||
/*Ox.print(e.offsetX, Ox.limit(
|
||||
/*Ox.Log('Video', e.offsetX, Ox.limit(
|
||||
(e.offsetX - self.barHeight / 2) / self.timelineImageWidth * self.video.duration,
|
||||
0, self.video.duration
|
||||
))*/
|
||||
|
|
@ -1272,7 +1272,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function getProgressImageURL() {
|
||||
//Ox.print('---', self.timelineImageWidth)
|
||||
//Ox.Log('Video', '---', self.timelineImageWidth)
|
||||
if (!self.timelineImageWidth) return;
|
||||
var width = self.timelineImageWidth,
|
||||
height = self.barHeight,
|
||||
|
|
@ -1347,7 +1347,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
});
|
||||
//Ox.print('??', $timeline.find('.OxInterface'))
|
||||
//Ox.Log('Video', '??', $timeline.find('.OxInterface'))
|
||||
$timeline.children().css({
|
||||
marginLeft: getTimelineLeft() + 'px'
|
||||
});
|
||||
|
|
@ -1472,7 +1472,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function hideControls() {
|
||||
//Ox.print('hideControls');
|
||||
//Ox.Log('Video', 'hideControls');
|
||||
clearTimeout(self.interfaceTimeout);
|
||||
self.interfaceTimeout = setTimeout(function() {
|
||||
if (!self.exitFullscreen && !self.inputHasFocus && !self.mouseIsInControls) {
|
||||
|
|
@ -1546,7 +1546,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
|
||||
function loadedmetadata() {
|
||||
|
||||
Ox.print('LOADEDMETADATA')
|
||||
Ox.Log('Video', 'LOADEDMETADATA')
|
||||
|
||||
var hadDuration = !!self.options.duration;
|
||||
|
||||
|
|
@ -1565,7 +1565,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
self.out = self.options.playInToOut && self.out < self.$video.duration()
|
||||
? self.out : self.$video.duration();
|
||||
self.options.duration = self.out - self['in'];
|
||||
Ox.print('---------------------------------------- POS', self.options.position)
|
||||
Ox.Log('Video', '---------------------------------------- POS', self.options.position)
|
||||
//self.options.position = Ox.limit(self.options.position, self['in'], self.out);
|
||||
//self.$video.currentTime(self.options.position);
|
||||
|
||||
|
|
@ -1667,7 +1667,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
self.out = points[1];
|
||||
self.options.duration = self.out - self['in'];
|
||||
setPosition(self['in']);
|
||||
Ox.print('POINTSCHANGE', self['in'], self.out, self.options.position, self.options.duration)
|
||||
Ox.Log('Video', 'POINTSCHANGE', self['in'], self.out, self.options.position, self.options.duration)
|
||||
}
|
||||
|
||||
function progress() {
|
||||
|
|
@ -1691,34 +1691,34 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function seeked() {
|
||||
Ox.print('XX seeked')
|
||||
Ox.Log('Video', 'XX seeked')
|
||||
clearTimeout(self.seekTimeout);
|
||||
self.seekTimeout = 0;
|
||||
Ox.print('XX hide')
|
||||
Ox.Log('Video', 'XX hide')
|
||||
hideLoadingIcon();
|
||||
self.$playIcon && self.$playIcon.show();
|
||||
}
|
||||
|
||||
function seeking() {
|
||||
Ox.print('XX seeking')
|
||||
Ox.Log('Video', 'XX seeking')
|
||||
if (!self.seekTimeout) {
|
||||
self.seekTimeout = setTimeout(function() {
|
||||
self.$playIcon && self.$playIcon.hide();
|
||||
Ox.print('XX show')
|
||||
Ox.Log('Video', 'XX show')
|
||||
showLoadingIcon();
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
function setMarkers() {
|
||||
//Ox.print('SET MARKERS', self.options.position, self.options['in'], self.options.out, self.$pointMarker);
|
||||
//Ox.Log('Video', 'SET MARKERS', self.options.position, self.options['in'], self.options.out, self.$pointMarker);
|
||||
Ox.forEach(self.$posterMarker, function(marker) {
|
||||
isEqual(self.options.position, self.options.posterFrame) ?
|
||||
marker.show() : marker.hide();
|
||||
});
|
||||
Ox.forEach(self.$pointMarker, function(markers, point) {
|
||||
Ox.forEach(markers, function(marker) {
|
||||
//Ox.print(self.options.position, self.options[point], isEqual(self.options.position, self.options[point]))
|
||||
//Ox.Log('Video', self.options.position, self.options[point], isEqual(self.options.position, self.options[point]))
|
||||
// fixme: there's a bug in jquery and/or webkit
|
||||
// on load, show() doesn't work
|
||||
isEqual(self.options.position, self.options[point]) ?
|
||||
|
|
@ -1863,14 +1863,14 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function setSubtitleText() {
|
||||
//Ox.print('setSubTx', self.subtitle, self.options.find)
|
||||
//Ox.Log('Video', 'setSubTx', self.subtitle, self.options.find)
|
||||
self.$subtitle.html(
|
||||
self.subtitle ?
|
||||
Ox.highlight(self.subtitle, self.options.find, 'OxHighlight')
|
||||
.replace(/\n/g, '<br/>') : ' <br/> '
|
||||
// FIXME: weird bug, only in fullscreen, only in chrome
|
||||
);
|
||||
//Ox.print('?!?', self.$subtitle.css('bottom'), self.$subtitle.height())
|
||||
//Ox.Log('Video', '?!?', self.$subtitle.css('bottom'), self.$subtitle.height())
|
||||
}
|
||||
|
||||
function sizechange() {
|
||||
|
|
@ -1907,7 +1907,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function showControls() {
|
||||
//Ox.print('showControls');
|
||||
//Ox.Log('Video', 'showControls');
|
||||
clearTimeout(self.interfaceTimeout);
|
||||
if (!self.interfaceIsVisible) {
|
||||
self.interfaceIsVisible = true;
|
||||
|
|
@ -1997,7 +1997,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
function submitPositionInput() {
|
||||
self.$positionInput.hide();
|
||||
self.$position.html('').show();
|
||||
//Ox.print('###', parsePositionInput(self.$positionInput.options('value')))
|
||||
//Ox.Log('Video', '###', parsePositionInput(self.$positionInput.options('value')))
|
||||
setPosition(parsePositionInput(self.$positionInput.options('value')));
|
||||
if (self.playOnSubmit) {
|
||||
togglePaused();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue