forked from 0x2620/oxjs
make 'censored' icon/link/tooltip configurable (fixes #252)
This commit is contained in:
parent
bdab9b8a7d
commit
f0d4043fd4
6 changed files with 89 additions and 42 deletions
|
|
@ -25,6 +25,8 @@ Ox.VideoEditor = function(options, self) {
|
|||
annotationsSize: 256,
|
||||
annotationsSort: 'position',
|
||||
censored: [],
|
||||
censoredIcon: '',
|
||||
censoredTooltip: '',
|
||||
clickLink: null,
|
||||
cuts: [],
|
||||
duration: 0,
|
||||
|
|
@ -236,6 +238,8 @@ Ox.VideoEditor = function(options, self) {
|
|||
['play', 'in', 'out'].forEach(function(type, i) {
|
||||
self.$player[i] = Ox.VideoPlayer({
|
||||
censored: self.options.censored,
|
||||
censoredIcon: self.options.censoredIcon,
|
||||
censoredTooltip: self.options.censoredTooltip,
|
||||
controlsBottom: type == 'play' ?
|
||||
['play', 'playInToOut', 'volume', 'size', 'space', 'position'] :
|
||||
['goto', 'set', 'space', 'position'],
|
||||
|
|
@ -267,42 +271,48 @@ Ox.VideoEditor = function(options, self) {
|
|||
left: self.sizes.player[i].left + 'px',
|
||||
top: self.sizes.player[i].top + 'px'
|
||||
})
|
||||
.bindEvent(type == 'play' ? {
|
||||
muted: function(data) {
|
||||
that.triggerEvent('muted', data);
|
||||
},
|
||||
paused: function(data) {
|
||||
that.triggerEvent('paused', data);
|
||||
},
|
||||
playing: function(data) {
|
||||
setPosition(data.position, true);
|
||||
},
|
||||
position: function(data) {
|
||||
setPosition(data.position);
|
||||
},
|
||||
resolution: function(data) {
|
||||
that.triggerEvent('resolution', data);
|
||||
},
|
||||
size: function() {
|
||||
toggleSize();
|
||||
},
|
||||
subtitles: function(data) {
|
||||
that.triggerEvent('subtitles', data);
|
||||
},
|
||||
volume: function(data) {
|
||||
that.triggerEvent('volume', data);
|
||||
}
|
||||
} : {
|
||||
gotopoint: function() {
|
||||
goToPoint(type);
|
||||
},
|
||||
position: function(data) {
|
||||
setPoint(type, data.position);
|
||||
},
|
||||
setpoint: function() {
|
||||
setPoint(type, self.options.position);
|
||||
}
|
||||
})
|
||||
.bindEvent(
|
||||
Ox.extend({
|
||||
censored: function() {
|
||||
that.triggerEvent('censored');
|
||||
}
|
||||
}, type == 'play' ? {
|
||||
muted: function(data) {
|
||||
that.triggerEvent('muted', data);
|
||||
},
|
||||
paused: function(data) {
|
||||
that.triggerEvent('paused', data);
|
||||
},
|
||||
playing: function(data) {
|
||||
setPosition(data.position, true);
|
||||
},
|
||||
position: function(data) {
|
||||
setPosition(data.position);
|
||||
},
|
||||
resolution: function(data) {
|
||||
that.triggerEvent('resolution', data);
|
||||
},
|
||||
size: function() {
|
||||
toggleSize();
|
||||
},
|
||||
subtitles: function(data) {
|
||||
that.triggerEvent('subtitles', data);
|
||||
},
|
||||
volume: function(data) {
|
||||
that.triggerEvent('volume', data);
|
||||
}
|
||||
} : {
|
||||
gotopoint: function() {
|
||||
goToPoint(type);
|
||||
},
|
||||
position: function(data) {
|
||||
setPoint(type, data.position);
|
||||
},
|
||||
setpoint: function() {
|
||||
setPoint(type, self.options.position);
|
||||
}
|
||||
})
|
||||
)
|
||||
.appendTo(self.$editor);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue