1
0
Fork 0
forked from 0x2620/oxjs

make 'censored' icon/link/tooltip configurable (fixes #252)

This commit is contained in:
rlx 2012-04-22 09:57:17 +00:00
commit f0d4043fd4
6 changed files with 89 additions and 42 deletions

View file

@ -12,6 +12,8 @@ Ox.VideoPlayer <f> Generic Video Player
out <n> Out point (sec)
text <s> Text
censored <a|[]> Array of censored ranges
censoredIcon <s|''> 'Censored' icon
censoredTooltip <s|''> Tooltip for 'censored' icon
controlsBottom <[s]|[]> Bottom controls, from left to right
Can be 'close', fullscreen', 'scale', 'title', 'find', 'open',
'play', 'playInToOut', 'previous', 'next', 'mute', 'volume', 'size',
@ -84,6 +86,8 @@ Ox.VideoPlayer = function(options, self) {
annotations: [],
brightness: 1,
censored: [],
censoredIcon: '',
censoredTooltip: '',
controlsBottom: [],
controlsTooltips: {},
controlsTop: [],
@ -298,7 +302,8 @@ Ox.VideoPlayer = function(options, self) {
self.options.enableMouse && self.$videoContainer.bindEvent({
anyclick: function(e) {
if (!$(e.target).is('.OxLogo')) {
var $target = $(e.target);
if (!$target.is('.OxLogo') && !$target.is('.OxCensoredIcon')) {
togglePaused();
}
},
@ -439,14 +444,18 @@ Ox.VideoPlayer = function(options, self) {
if (self.options.censored.length) {
self.$copyrightIcon = Ox.Element({
element: '<img>',
// fixme: make this configurable
tooltip: 'This part of this video is not available in<br/>your part of your country. Sorry for that.'
tooltip: self.options.censoredTooltip
})
.addClass('OxCopyrightIcon OxVideo')
.addClass('OxCensoredIcon OxVideo')
.attr({
src: Ox.UI.getImageURL('symbolNoCopyright', 'modern'),
src: Ox.UI.getImageURL('symbol' + self.options.censoredIcon, 'modern'),
})
.hide()
.bindEvent({
anyclick: function() {
that.triggerEvent('censored');
}
})
.appendTo(self.$videoContainer);
}