forked from 0x2620/oxjs
in video editor, keep menu and player size in sync (fixes #405)
This commit is contained in:
parent
972808eb17
commit
95da27d0db
4 changed files with 30 additions and 11 deletions
|
|
@ -140,9 +140,6 @@ Ox.VideoEditor = function(options, self) {
|
|||
key_right: function() {
|
||||
movePositionBy(0.04);
|
||||
},
|
||||
key_s: function() {
|
||||
// toggleSize
|
||||
},
|
||||
key_shift_down: function() {
|
||||
movePositionBy(self.options.duration);
|
||||
},
|
||||
|
|
@ -266,7 +263,9 @@ Ox.VideoEditor = function(options, self) {
|
|||
resolution: function(data) {
|
||||
that.triggerEvent('resolution', data);
|
||||
},
|
||||
size: toggleSize,
|
||||
size: function() {
|
||||
toggleSize();
|
||||
},
|
||||
subtitles: function(data) {
|
||||
that.triggerEvent('subtitles', data);
|
||||
},
|
||||
|
|
@ -417,7 +416,10 @@ Ox.VideoEditor = function(options, self) {
|
|||
|
||||
self.$videoMenuButton = Ox.MenuButton({
|
||||
items: Ox.merge([
|
||||
{id: 'toggleSize', title: 'Large Player', checked: self.options.playerSize == 'large', keyboard: 'shift +'},
|
||||
{group: 'size', min: 1, max: 1, items: [
|
||||
{id: 'small', title: 'Small Player', checked: self.options.videoSize == 'small'},
|
||||
{id: 'large', title: 'Large Player', checked: self.options.videoSize == 'large'}
|
||||
]},
|
||||
{},
|
||||
{group: 'resolution', min: 1, max: 1, items: self.resolutions},
|
||||
{},
|
||||
|
|
@ -476,11 +478,11 @@ Ox.VideoEditor = function(options, self) {
|
|||
},
|
||||
change: function(data) {
|
||||
var id = data.id;
|
||||
if (id == 'toggleSize') {
|
||||
toggleSize();
|
||||
} else if (data.id == 'resolution') {
|
||||
if (id == 'resolution') {
|
||||
self.options.resolution = parseInt(data.checked[0].id);
|
||||
self.$player[0].options({resolution: self.options.resolution});
|
||||
} else if (id == 'size') {
|
||||
toggleSize();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -1208,6 +1210,10 @@ Ox.VideoEditor = function(options, self) {
|
|||
function toggleSize() {
|
||||
self.options.videoSize = self.options.videoSize == 'small' ? 'large' : 'small';
|
||||
setSizes();
|
||||
self.$videoMenuButton.checkItem(self.options.videoSize);
|
||||
self.$player[0].options({
|
||||
sizeIsLarge: self.options.videoSize == 'large'
|
||||
});
|
||||
that.triggerEvent('togglesize', {
|
||||
size: self.options.videoSize
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue