This commit is contained in:
rlx 2012-02-16 16:36:26 +00:00
commit e1d8e2aeea
3 changed files with 21 additions and 12 deletions

View file

@ -526,7 +526,7 @@ Ox.URL = function(options) {
}
if (!state.span && /^[A-Z@]/.test(parts[0])) {
// test for span id or name
self.options.getSpan(state.item, state.view, parts[0].replace(/%20/g, ' '), function(span, view) {
self.options.getSpan(state.item, state.view, decodeValue(parts[0]), function(span, view) {
Ox.Log('Core', 'span/view', span, view)
if (span) {
if (!state.view) {
@ -708,4 +708,4 @@ Ox.URL = function(options) {
return that;
};
};

View file

@ -471,6 +471,9 @@ Ox.VideoEditor = function(options, self) {
setPosition(self.options.posterFrame);
} else if (id == 'setPosterFrame') {
self.options.posterFrame = self.options.position;
self.$player.forEach(function($player) {
$player.options('posterFrame', self.options.posterFrame);
});
that.triggerEvent('posterframe', {
position: self.options.posterFrame
});

View file

@ -23,7 +23,7 @@ Ox.VideoElement = function(options, self) {
.options(options || {})
.css({width: '100%', height: '100%'});
Ox.Log('Video', 'VIDEO ELEMENT OPTIONS', self.options)
Ox.Log('Video', 'VIDEO ELEMENT OPTIONS', self.options);
self.items = [];
self.paused = true;
@ -64,7 +64,7 @@ Ox.VideoElement = function(options, self) {
function getset(key, value) {
var ret;
if (Ox.isUndefined(value)) {
ret = self.video[key]
ret = self.video[key];
} else {
self.video[key] = value;
ret = that;
@ -73,7 +73,7 @@ Ox.VideoElement = function(options, self) {
}
function loadPage(page, callback) {
Ox.Log('Video', 'VIDEO loadPage', page)
Ox.Log('Video', 'VIDEO loadPage', page);
//page = Ox.mod(page, self.numberOfPages);
var loadedmetadata = 0,
start = page * self.pageLength,
@ -84,14 +84,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.Log('Video', 'VIDEO page', page, 'loaded')
Ox.Log('Video', 'VIDEO page', page, 'loaded');
callback && callback();
}
});
});
});
} else {
Ox.Log('Video', 'PAGE IN CACHE')
Ox.Log('Video', 'PAGE IN CACHE');
callback && callback();
}
}
@ -236,7 +236,9 @@ Ox.VideoElement = function(options, self) {
function setCurrentPart(part) {
Ox.Log('Video', 'sCP', part);
var css = {};
var css = {},
muted = false,
volume = 1;
['left', 'top', 'width', 'height'].forEach(function(key) {
css[key] = self.$video.css(key);
});
@ -244,12 +246,16 @@ Ox.VideoElement = function(options, self) {
self.$video.hide();
self.video.pause();
self.video.currentTime = 0;
volume = self.video.volume;
muted = self.video.muted;
}
self.$video = self.items[self.currentItem].$videos[part].css(css).show();
self.video = self.$video[0];
self.video.volume = volume;
self.video.muted = muted;
!self.paused && self.video.play();
self.currentPart = part;
Ox.Log('Video', 'sCP', part, self.video.src)
Ox.Log('Video', 'sCP', part, self.video.src);
}
function setCurrentTime(time) {
@ -272,7 +278,7 @@ Ox.VideoElement = function(options, self) {
function unloadPage(page) {
//page = Ox.mod(page, self.numberOfPages);
Ox.Log('Video', '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) {
@ -397,7 +403,7 @@ Ox.VideoElement = function(options, self) {
playNext <f> play next
@*/
that.playNext = function() {
Ox.Log('Video', 'PLAY NEXT')
Ox.Log('Video', 'PLAY NEXT');
setCurrentItem(self.currentItem + 1);
self.video.play();
};
@ -448,7 +454,7 @@ Ox.VideoElement = function(options, self) {
@*/
that.volume = function(value) {
return getset('volume', arguments[0]);
}
};
return that;