faster timeline markers

This commit is contained in:
j 2014-09-23 12:13:10 +02:00
parent be043b545b
commit 5f69fd35df

View file

@ -98,16 +98,19 @@ Ox.LargeVideoTimeline = function(options, self) {
setTimeout(function() {
var chapters = self.options.chapters.slice(1).map(function(chapter) {
return chapter.position;
});
}),
$cut =$('<img>')
.addClass('OxCut')
.attr({src: Ox.UI.getImageURL('markerCut')}),
$chapter =$('<img>')
.addClass('OxChapter')
.attr({src: Ox.UI.getImageURL('markerChapter')});
Ox.unique(chapters.concat(self.options.cuts)).forEach(function(v, i) {
self.$cuts[i] = $('<img>')
.addClass(Ox.contains(chapters, v) ? 'OxChapter' : 'OxCut')
self.$cuts[i] = (Ox.contains(chapters, v) ? $chapter : $cut)
.clone()
.css({left: (v * self.fps) + 'px'})
.appendTo(self.$timeline);
});
// performs better
self.$timeline.find('.OxChapter').attr({src: Ox.UI.getImageURL('markerChapter')});
self.$timeline.find('.OxCut').attr({src: Ox.UI.getImageURL('markerCut')});
});
self.$markerPosition = $('<img>')