load timeline overlays(subtitles, cuts, results) more asynchronously

This commit is contained in:
j 2014-02-02 18:48:45 +00:00
parent ca22ed9c8a
commit be9ec5a86a
2 changed files with 21 additions and 16 deletions

View file

@ -71,7 +71,7 @@ Ox.LargeVideoTimeline = function(options, self) {
.css({left: self.center + 'px'}) .css({left: self.center + 'px'})
.appendTo(that); .appendTo(that);
setSubtitles(); setTimeout(setSubtitles);
if (self.options.showInToOut) { if (self.options.showInToOut) {
if (self.options['in']) { if (self.options['in']) {
@ -94,6 +94,7 @@ Ox.LargeVideoTimeline = function(options, self) {
} }
} }
setTimeout(function() {
self.options.cuts.forEach(function(v, i) { self.options.cuts.forEach(function(v, i) {
self.$cuts[i] = $('<img>') self.$cuts[i] = $('<img>')
.addClass('OxCut') .addClass('OxCut')
@ -101,6 +102,7 @@ Ox.LargeVideoTimeline = function(options, self) {
.appendTo(self.$timeline); .appendTo(self.$timeline);
}); });
self.$timeline.find('.OxCut').attr({src: Ox.UI.getImageURL('markerCut')}); self.$timeline.find('.OxCut').attr({src: Ox.UI.getImageURL('markerCut')});
});
self.$markerPosition = $('<img>') self.$markerPosition = $('<img>')
.addClass('OxMarkerPosition') .addClass('OxMarkerPosition')

View file

@ -138,9 +138,6 @@ Ox.SmallVideoTimelineImage = function(options, self) {
} }
self.$subtitles = $('<img>') self.$subtitles = $('<img>')
.attr({
src: getImageURL('subtitles')
})
.css({ .css({
position: 'absolute', position: 'absolute',
top: self.imageTop + 'px', top: self.imageTop + 'px',
@ -150,9 +147,6 @@ Ox.SmallVideoTimelineImage = function(options, self) {
.appendTo(that); .appendTo(that);
self.$results = $('<img>') self.$results = $('<img>')
.attr({
src: getImageURL('results')
})
.css({ .css({
position: 'absolute', position: 'absolute',
top: self.imageTop + 'px', top: self.imageTop + 'px',
@ -162,9 +156,6 @@ Ox.SmallVideoTimelineImage = function(options, self) {
.appendTo(that); .appendTo(that);
self.$selection = $('<img>') self.$selection = $('<img>')
.attr({
src: getImageURL('selection')
})
.css({ .css({
position: 'absolute', position: 'absolute',
top: self.imageTop + 'px', top: self.imageTop + 'px',
@ -173,6 +164,18 @@ Ox.SmallVideoTimelineImage = function(options, self) {
}) })
.appendTo(that); .appendTo(that);
setTimeout(function() {
self.$subtitles.attr({
src: getImageURL('subtitles')
});
self.$results.attr({
src: getImageURL('results')
});
self.$selection.attr({
src: getImageURL('selection')
});
});
function getClipTimeline() { function getClipTimeline() {
var $canvas, context, image, var $canvas, context, image,
firstTile, lastTile, tileHeight, tileOffset, tileWidth; firstTile, lastTile, tileHeight, tileOffset, tileWidth;