forked from 0x2620/oxjs
handle video formats and resolutions
This commit is contained in:
parent
c5bde89971
commit
ba96bfb76c
5 changed files with 45 additions and 16 deletions
|
|
@ -31,8 +31,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
showAnnotations: false,
|
||||
showLargeTimeline: true,
|
||||
subtitles: [],
|
||||
videoHeight: 0,
|
||||
videoWidth: 0,
|
||||
videoRatio: 16/9,
|
||||
videoSize: 'small',
|
||||
video: '',
|
||||
width: 0
|
||||
|
|
@ -140,7 +139,6 @@ Ox.VideoEditor = function(options, self) {
|
|||
$timeline: [],
|
||||
controlsHeight: 16,
|
||||
margin: 8,
|
||||
videoRatio: self.options.videoWidth / self.options.videoHeight
|
||||
});
|
||||
|
||||
self.words = [];
|
||||
|
|
@ -772,7 +770,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
left: (i + 0.5) * self.margin + width,
|
||||
top: self.margin / 2,
|
||||
width: widths[i],
|
||||
height: Math.round(widths[1] / self.videoRatio)
|
||||
height: Math.round(widths[1] / self.options.videoRatio)
|
||||
};
|
||||
width += widths[i];
|
||||
});
|
||||
|
|
@ -780,15 +778,15 @@ Ox.VideoEditor = function(options, self) {
|
|||
size.player[0] = {
|
||||
left: self.margin / 2,
|
||||
top: self.margin / 2,
|
||||
width: Math.round((contentWidth - 3 * self.margin + (self.controlsHeight + self.margin) / 2 * self.videoRatio) * 2/3),
|
||||
width: Math.round((contentWidth - 3 * self.margin + (self.controlsHeight + self.margin) / 2 * self.options.videoRatio) * 2/3),
|
||||
};
|
||||
size.player[0].height = Math.round(size.player[0].width / self.videoRatio);
|
||||
size.player[0].height = Math.round(size.player[0].width / self.options.videoRatio);
|
||||
size.player[1] = {
|
||||
left: size.player[0].left + size.player[0].width + self.margin,
|
||||
top: size.player[0].top,
|
||||
width: contentWidth - 3 * self.margin - size.player[0].width
|
||||
};
|
||||
size.player[1].height = Math.ceil(size.player[1].width / self.videoRatio);
|
||||
size.player[1].height = Math.ceil(size.player[1].width / self.options.videoRatio);
|
||||
size.player[2] = {
|
||||
left: size.player[1].left,
|
||||
top: size.player[0].top + size.player[1].height + self.controlsHeight + self.margin,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue