faster timeline markers
This commit is contained in:
parent
be043b545b
commit
5f69fd35df
1 changed files with 10 additions and 7 deletions
|
@ -97,17 +97,20 @@ Ox.LargeVideoTimeline = function(options, self) {
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var chapters = self.options.chapters.slice(1).map(function(chapter) {
|
var chapters = self.options.chapters.slice(1).map(function(chapter) {
|
||||||
return chapter.position;
|
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) {
|
Ox.unique(chapters.concat(self.options.cuts)).forEach(function(v, i) {
|
||||||
self.$cuts[i] = $('<img>')
|
self.$cuts[i] = (Ox.contains(chapters, v) ? $chapter : $cut)
|
||||||
.addClass(Ox.contains(chapters, v) ? 'OxChapter' : 'OxCut')
|
.clone()
|
||||||
.css({left: (v * self.fps) + 'px'})
|
.css({left: (v * self.fps) + 'px'})
|
||||||
.appendTo(self.$timeline);
|
.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>')
|
self.$markerPosition = $('<img>')
|
||||||
|
|
Loading…
Reference in a new issue