in video panel player, rename showControls to showTimeline

This commit is contained in:
rlx 2011-11-05 22:15:10 +00:00
parent 2b3d8807d9
commit 8eac8c20d7
2 changed files with 14 additions and 23 deletions

View file

@ -30,7 +30,7 @@ Ox.VideoPanelPlayer = function(options, self) {
poster: '',
scaleToFill: false,
showAnnotations: true,
showControls: true,
showTimeline: true,
subtitles: [],
tooltips: false,
video: '',
@ -44,15 +44,6 @@ Ox.VideoPanelPlayer = function(options, self) {
})
.bindEvent({
resize: resizeElement,
key_shift_a: function() {
that.toggleAnnotations();
},
key_shift_c: function() {
that.toggleControls();
},
key_shift_s: function() {
that.toggleSize();
},
key_space: function() {
that.togglePlay();
}
@ -142,7 +133,7 @@ Ox.VideoPanelPlayer = function(options, self) {
element: self.$player
},
{
collapsed: !self.options.showControls,
collapsed: !self.options.showTimeline,
collapsible: true,
element: self.$controls,
size: 80,
@ -188,7 +179,7 @@ Ox.VideoPanelPlayer = function(options, self) {
function getPlayerHeight() {
return self.options.height -
self.options.showControls * 80 - 1;
self.options.showTimeline * 80 - 1;
}
function getPlayerWidth() {
@ -258,12 +249,12 @@ Ox.VideoPanelPlayer = function(options, self) {
}
function toggleControls(data) {
self.options.showControls = !data.collapsed;
self.options.showTimeline = !data.collapsed;
self.$video.options({
height: getPlayerHeight()
});
that.triggerEvent('togglecontrols', {
showControls: self.options.showControls
that.triggerEvent('toggletimeline', {
showTimeline: self.options.showTimeline
});
}
@ -285,6 +276,8 @@ Ox.VideoPanelPlayer = function(options, self) {
});
} else if (key == 'showAnnotations') {
that.$element.toggle(1);
} else if (key == 'showTimeline') {
self.$panel.toggle(1);
} else if (key == 'width') {
self.$video.options({
width: getPlayerWidth()
@ -295,22 +288,22 @@ Ox.VideoPanelPlayer = function(options, self) {
}
}
// fixme: can these be removed?
/*@
toggleAnnotations <f> toggle annotations
() -> <o> toggle visibility of annotations
@*/
that.toggleAnnotations = function() {
that.$element.toggle(1);
//that.toggleAnnotations(null, !self.options.showAnnotations);
};
/*@
toggleControls <f> toggle controls
() -> <o> toggle visibility of controls
toggleTimeline <f> toggle timeline
() -> <o> toggle visibility of timeline
@*/
that.toggleControls = function() {
that.toggleTimeline = function() {
self.$panel.toggle(1);
//that.toggleControls(null, !self.options.showControls);
};
return that;

View file

@ -1,7 +1,5 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
/*@
Ox.VideoPlayer <f> Generic Video Player
(options, self) -> <o> Video Player
@ -132,7 +130,7 @@ Ox.VideoPlayer = function(options, self) {
.options(options || {})
.addClass('OxVideoPlayer');
Ox.Log('Video', 'VIDEO PLAYER OPTIONS', self.options)
Ox.Log('VIDEO', 'VIDEO PLAYER OPTIONS', self.options)
Ox.UI.$window.bind({
resize: function() {