oxjs/demos/videoeditor/js/videoeditor.js

103 lines
3 KiB
JavaScript
Raw Normal View History

2011-05-18 16:00:29 +00:00
Ox.load('UI', {
debug: true,
theme: 'modern'
}, function() {
Ox.get('srt/0393109.srt', function(srt) {
var subtitles = Ox.parseSRT(srt, 25);
var $appPanel, $mainPanel;
2011-05-18 16:00:29 +00:00
var $videoEditor = Ox.VideoEditor({
annotationsSize: 256,
duration: 6336.08,
find: 'dode',
2011-05-18 18:30:58 +00:00
getFrameURL: function(position, width) {
return 'http://next.0xdb.org/0393109/frame/' + width + '/' + position + '.jpg'
},
2011-05-18 16:00:29 +00:00
getLargeTimelineImageURL: function(i) {
return 'http://next.0xdb.org/0393109/timelines/timeline.64.' + i + '.png';
},
getSmallTimelineImageURL: function(i) {
return 'http://next.0xdb.org/0393109/timelines/timeline.16.' + i + '.png';
},
height: window.innerHeight - 129,
'in': 3128.76,
out: 3130.72,
position: 3168.04,
posterFrame: 3168.04,
subtitles: subtitles,
video: {
96: 'http://next.0xdb.org/0393109/96p.webm',
240: 'http://next.0xdb.org/0393109/96p.webm?240p',
480: 'http://next.0xdb.org/0393109/96p.webm?480p'
},
videoHeight: 96,
videoSize: 'small',
2011-05-18 16:00:29 +00:00
videoWidth: 180,
width: window.innerWidth - 257
});
$appPanel = Ox.SplitPanel({
2011-05-18 16:00:29 +00:00
elements: [
{
collapsible: true,
element: Ox.Element(),
resizable: true,
resize: [128, 256, 384],
size: 256
},
{
element: $mainPanel = Ox.SplitPanel({
2011-05-18 16:00:29 +00:00
elements: [
{
collapsible: true,
element: Ox.Element(),
resizable: true,
resize: [64, 128, 192],
size: 128
},
{
element: $videoEditor
}
],
orientation: 'vertical'
})
}
],
orientation: 'horizontal'
})
.appendTo(Ox.UI.$body);
Ox.UI.$window.bind({
resize: function() {
$videoEditor.options({
width: $appPanel.size(1),
height: $mainPanel.size(1)
});
}
});
$mainPanel.bindEvent({
2011-05-18 16:00:29 +00:00
resize: function(foo, size) {
$videoEditor.options({
width: size
});
}
});
$videoEditor.bindEvent({
resize: function(foo, size) {
Ox.print('RESIZE!!!!!!!!!')
2011-05-18 16:00:29 +00:00
$videoEditor.options({
height: size
});
}
});
2011-05-18 16:00:29 +00:00
});
});