1
0
Fork 0
forked from 0x2620/oxjs

fix a resizing bug in the video editor demo

This commit is contained in:
rolux 2011-05-19 09:06:42 +02:00
commit 67c154547c
4 changed files with 36 additions and 16 deletions

View file

@ -128,7 +128,6 @@ Ox.BlockVideoTimeline = function(options, self) {
function getPosition(e) {
//FIXME: this might still be broken in opera according to http://acko.net/blog/mouse-handling-and-absolute-positions-in-javascript
Ox.print('offsetX', e.offsetX)
return (e.offsetX ? e.offsetX : e.clientX - $(e.target).offset().left);
}

View file

@ -101,7 +101,6 @@ Ox.VideoEditor = function(options, self) {
},
key_shift_left: function() {
movePositionBy(1);
//movePositionBy(-60);
},
key_shift_i: function() {
goToPoint('in');
@ -109,9 +108,11 @@ Ox.VideoEditor = function(options, self) {
key_shift_o: function() {
goToPoint('out');
},
key_shift_p: function() {
// go to poster frame
},
key_shift_right: function() {
movePositionBy(1);
//movePositionBy(60);
},
key_shift_up: function() {
movePositionBy(-self.options.position);
@ -429,6 +430,7 @@ Ox.VideoEditor = function(options, self) {
self.$editor.css({
overflowY: (scrollbarIsVisible && height <= self.options.height) ? 'scroll' : 'auto'
});
//Ox.print('getSizes', scrollbarIsVisible, height, self.options.height, size)
return (!scrollbarIsVisible && height > self.options.height) ? getSizes(true) : size;
function getHeight() {
return size.player[0].height + self.controlsHeight +

View file

@ -3951,7 +3951,7 @@ Ox.parseSRT <f> Parses an srt subtitle file
> Ox.parseSRT('1\n01:02:00,000 --> 01:02:03,400\nHello World')
[{'in': 3720, out: 3723.4, text: 'Hello World'}]
@*/
Ox.parseSRT = function(str) {
Ox.parseSRT = function(str, fps) {
return str.replace(/\r\n/g, '\n').replace(/\n+$/, '').split('\n\n')
.map(function(block) {
var lines = block.split('\n'), points;
@ -3963,6 +3963,11 @@ Ox.parseSRT = function(str) {
[3600, 60, 1, 0.001][i];
}, 0);
});
if (fps) {
points = points.map(function(point) {
return Math.round(point * fps) / fps;
});
}
return {
'in': points[0],
out: points[1],