1
0
Fork 0
forked from 0x2620/oxjs

change video resolution, trigger ended event in player

This commit is contained in:
j 2011-12-20 18:39:26 +05:30
commit 6e0ff7158c
4 changed files with 29 additions and 10 deletions

View file

@ -35,6 +35,7 @@ Ox.VideoEditor = function(options, self) {
position: 0,
posterFrame: 0,
posterFrameControls: false,
resolution: 0,
showAnnotations: false,
showLargeTimeline: true,
subtitles: [],
@ -190,6 +191,7 @@ Ox.VideoEditor = function(options, self) {
paused: true,
position: type == 'play' ? self.options.position : self.options[type],
posterFrame: self.options.posterFrame,
resolution: self.options.resolution,
showMarkers: true,
showMilliseconds: 3,
sizeIsLarge: self.options.videoSize == 'large',
@ -215,6 +217,9 @@ Ox.VideoEditor = function(options, self) {
changePlayer(data);
that.triggerEvent('position', data);
},
resolution: function(data) {
that.triggerEvent('resolution', data);
},
size: toggleSize,
volume: function(data) {
that.triggerEvent('volume', data);
@ -326,9 +331,10 @@ Ox.VideoEditor = function(options, self) {
self.resolutions = [];
Ox.forEach(self.options.video, function(url, resolution) {
Ox.Log('Video', url, resolution)
Ox.Log('Video', url, resolution);
self.resolutions.push(
{id: resolution + '', title: resolution + 'p'}
{id: resolution + '', title: resolution + 'p',
checked: self.options.resolution == resolution}
);
});
@ -425,6 +431,9 @@ Ox.VideoEditor = function(options, self) {
title: 'Keyboard Shortcuts',
width: 256
}).open();
} else if (Ox.getObjectById(self.resolutions, id)) {
//FIXME: uncheck previous resolution
self.$player[0].options({resolution: id});
}
}
})
@ -445,13 +454,12 @@ Ox.VideoEditor = function(options, self) {
self.$resolutionSelect = Ox.Select({
items: [{id: '96', title: '96p'},{id: '240', title: '240p'}],//self.resolutions,
width: 48
items: self.resolutions,
width: 48,
})
.css({float: 'left'})
.bindEvent({
change: function() {
change: function(data) {
}
});
//.appendTo(self.$videobar);