fix large timeline

This commit is contained in:
j 2013-07-14 09:14:23 +00:00
parent 72f1b47e1c
commit a0b92c16e5

View file

@ -46,7 +46,9 @@ Ox.VideoEditPanel = function(options, self) {
self.$clipPanel.options({clips: Ox.clone(self.options.clips)}); self.$clipPanel.options({clips: Ox.clone(self.options.clips)});
}, },
duration: function() { duration: function() {
self.$timeline.options({duration: self.options.duration}); self.$timeline && self.$timeline.replaceWith(
self.$timeline = getTimeline()
);
}, },
fullscreen: function() { fullscreen: function() {
self.$video.options({fullscreen: self.options.fullscreen}); self.$video.options({fullscreen: self.options.fullscreen});
@ -137,6 +139,9 @@ Ox.VideoEditPanel = function(options, self) {
width: getPlayerWidth() width: getPlayerWidth()
}) })
.bindEvent({ .bindEvent({
durationchange: function(data) {
that.options({duration: data.duration});
},
fullscreen: function(data) { fullscreen: function(data) {
self.options.fullscreen = data.fullscreen; self.options.fullscreen = data.fullscreen;
}, },
@ -180,21 +185,7 @@ Ox.VideoEditPanel = function(options, self) {
toggle: toggleControls toggle: toggleControls
}); });
self.$timeline = Ox.LargeVideoTimeline({ self.$timeline = getTimeline()
duration: self.options.duration,
getImageURL: self.options.getLargeTimelineURL,
'in': self.options['in'],
out: self.options.out,
position: self.options.position,
subtitles: self.options.enableSubtitles ? self.options.subtitles : [],
type: self.options.timeline,
width: getTimelineWidth()
})
.css({left: '4px', top: '4px'})
.bindEvent({
mousedown: that.gainFocus,
position: changeTimeline
})
.appendTo(self.$controls); .appendTo(self.$controls);
self.$videoPanel = Ox.SplitPanel({ self.$videoPanel = Ox.SplitPanel({
@ -301,12 +292,31 @@ Ox.VideoEditPanel = function(options, self) {
* self.options.clipSize - 1; * self.options.clipSize - 1;
} }
function getTimeline() {
return Ox.LargeVideoTimeline({
duration: self.options.duration,
getImageURL: self.options.getLargeTimelineURL,
'in': self.options['in'],
out: self.options.out,
position: self.options.position,
subtitles: self.options.enableSubtitles ? self.options.subtitles : [],
type: self.options.timeline,
width: getTimelineWidth()
})
.css({left: '4px', top: '4px'})
.bindEvent({
mousedown: that.gainFocus,
position: changeTimeline
})
}
function getTimelineWidth() { function getTimelineWidth() {
return self.options.width - return self.options.width -
(self.options.showClips && !self.fullscreen) (self.options.showClips && !self.fullscreen)
* self.options.clipSize - 16 - 1; * self.options.clipSize - 16 - 1;
} }
function resizeClips(data) { function resizeClips(data) {
// called on clips resize // called on clips resize
self.options.clipSize = data.size; self.options.clipSize = data.size;