diff --git a/source/UI/js/Video/ClipPanel.js b/source/UI/js/Video/ClipPanel.js index e5095210..d61f79dc 100644 --- a/source/UI/js/Video/ClipPanel.js +++ b/source/UI/js/Video/ClipPanel.js @@ -175,6 +175,21 @@ Ox.ClipPanel = function(options, self) { visible: true, width: 90 }, + { + align: 'right', + editable: self.options.editable, + format: function(value, data) { + return Ox.formatNumber(value, 2); + }, + id: 'volume', + operator: '+', + sort: function(value, data) { + return data.sort; + }, + title: Ox._('Volume'), + visible: false, + width: 45 + }, { addable: false, id: 'sort', @@ -491,23 +506,34 @@ Ox.ClipPanel = function(options, self) { }, submit: function(data) { var value = self.$list.value(data.id); - data.value = Ox.parseDuration(data.value); - if ( - (data.key == 'in' && data.value < value.out) - || (data.key == 'out' && data.value > value['in']) - || (data.key == 'duration' && data.value > 0) - ) { - self.$list.value(data.id, data.key, data.value); - if (data.key == 'in') { - self.$list.value(data.id, 'duration', value.out - data.value); - } else if (data.key == 'out') { - self.$list.value(data.id, 'duration', data.value - value['in']); - } else if (data.key == 'duration') { - self.$list.value(data.id, 'out', value['in'] + data.value); + if (data.key == 'volume') { + data.value = parseFloat(data.value); + if (data.value >= 1 || Ox.isNaN(data.value)) { + data.value = 1; + } else if (data.value < 0) { + data.value = 0; } + self.$list.value(data.id, data.key, data.value); that.triggerEvent('edit', data); } else { - self.$list.value(data.id, data.key, value[data.key]); + data.value = Ox.parseDuration(data.value); + if ( + (data.key == 'in' && data.value < value.out) + || (data.key == 'out' && data.value > value['in']) + || (data.key == 'duration' && data.value > 0) + ) { + self.$list.value(data.id, data.key, data.value); + if (data.key == 'in') { + self.$list.value(data.id, 'duration', value.out - data.value); + } else if (data.key == 'out') { + self.$list.value(data.id, 'duration', data.value - value['in']); + } else if (data.key == 'duration') { + self.$list.value(data.id, 'out', value['in'] + data.value); + } + that.triggerEvent('edit', data); + } else { + self.$list.value(data.id, data.key, value[data.key]); + } } } }); diff --git a/source/UI/js/Video/VideoAnnotationPanel.js b/source/UI/js/Video/VideoAnnotationPanel.js index e9d1d2c6..9f35eea6 100644 --- a/source/UI/js/Video/VideoAnnotationPanel.js +++ b/source/UI/js/Video/VideoAnnotationPanel.js @@ -147,6 +147,11 @@ Ox.VideoAnnotationPanel = function(options, self) { self.$menuButton.checkItem('timelines_' + self.options.timeline); updateTimelines(); }, + volume: function() { + self.$player[0].options({ + volume: self.options.volume + }); + }, width: setSizes }) .bindEvent({ diff --git a/source/UI/js/Video/VideoEditPanel.js b/source/UI/js/Video/VideoEditPanel.js index fb1e64f7..4dc06243 100644 --- a/source/UI/js/Video/VideoEditPanel.js +++ b/source/UI/js/Video/VideoEditPanel.js @@ -140,6 +140,11 @@ Ox.VideoEditPanel = function(options, self) { cuts: self.cuts }); }, + volume: function() { + self.$video.options({ + volume: self.options.volume + }); + }, width: function() { self.$video.options({width: getPlayerWidth()}); self.$timeline.options({width: getTimelineWidth()}); diff --git a/source/UI/js/Video/VideoElement.js b/source/UI/js/Video/VideoElement.js index 62c16857..225610c7 100644 --- a/source/UI/js/Video/VideoElement.js +++ b/source/UI/js/Video/VideoElement.js @@ -101,6 +101,7 @@ Ox.VideoElement = function(options, self) { self.$videos = [getVideo(), getVideo()]; self.$video = self.$videos[self.currentVideo]; self.video = self.$video[0]; + self.volume = 1; self.$brightness = $('