forked from 0x2620/oxjs
video editor improvements
This commit is contained in:
parent
f8ec3fccf4
commit
a1deb20f97
8 changed files with 89 additions and 50 deletions
|
|
@ -19,11 +19,6 @@ Ox.SmallVideoTimelineImage = function(options, self) {
|
|||
width: self.options.width + 'px'
|
||||
});
|
||||
|
||||
// fixme: unless we do a block timeline,
|
||||
// we can always use a single 1920 png
|
||||
// fixme: timeline doesn't have to go through canvas at all,
|
||||
// just use one or more images
|
||||
|
||||
self.images = Ox.isString(self.options.timeline) ?
|
||||
1 : Math.ceil(self.options.duration / 3600);
|
||||
self.imageWidth = Ox.isString(self.options.timeline) ?
|
||||
|
|
@ -169,16 +164,17 @@ Ox.SmallVideoTimelineImage = function(options, self) {
|
|||
right = Math.round(
|
||||
subtitle.out / self.options.duration * self.imageWidth
|
||||
) + 1,
|
||||
top = bottom - subtitle.text.split('\n').length - 2;
|
||||
top = bottom - subtitle.text.split('\n').length - 3;
|
||||
Ox.loop(left, right, function(x) {
|
||||
Ox.loop(top, bottom, function(y) {
|
||||
var color = (y == top || y == bottom - 1) ?
|
||||
[0, 0, 0] : [255, 255, 255],
|
||||
var color = y == top ? [0, 0, 0, 0] :
|
||||
(y == top + 1 || y == bottom - 1) ?
|
||||
[0, 0, 0, 128] : [255, 255, 255, 128],
|
||||
index = x * 4 + y * 4 * width;
|
||||
data[index] = color[0];
|
||||
data[index + 1] = color[1];
|
||||
data[index + 2] = color[2];
|
||||
data[index + 3] = 128;
|
||||
data[index + 3] = color[3];
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue