extended video demo

This commit is contained in:
rolux 2011-05-14 21:32:49 +02:00
parent 568629fb34
commit 4255470e29
5 changed files with 628 additions and 323 deletions

View file

@ -2,37 +2,154 @@ Ox.load('UI', {
debug: true, debug: true,
theme: 'modern' theme: 'modern'
}, function() { }, function() {
var id = '0393109'; var id = '0393109',
var url = 'http://next.0xdb.org/' + id + '/96p.webm?' + Ox.random(1000000); poster = 'http://next.0xdb.org/' + id + '/poster.jpg',
var timeline = 'http://next.0xdb.org/' + id + '/timeline.16.png'; timeline = 'http://next.0xdb.org/' + id + '/timeline.16.png',
Ox.UI.$body.css({ url = 'http://next.0xdb.org/' + id + '/96p.webm',
padding: '16px' videoSize = getVideoSize(),
}); $videos = [
Ox.VideoPlayer({ Ox.VideoPlayer({
controls: ['play', 'mute', 'size', 'scale', 'timeline', 'position'], controls: ['play', 'mute', 'scale', 'timeline', 'position'],
height: 96 * 384/180,//96 * 256/180, enableKeyboard: true,
logoLink: 'http://next.0xdb.org/' + id, focus: 'mouseenter',
logoTitle: 'Watch on 0xdb', height: 192,
logo: 'png/logo.png', logoLink: 'http://next.0xdb.org/' + id,
paused: true, logoTitle: 'Watch on 0xdb',
scaleToFill: true, logo: 'png/logo.png',
subtitles: 'srt/' + id + '.srt', paused: true,
timeline: timeline, poster: poster,
title: '<b>Brick</b> - Rian Johnson - 2005', showIconOnLoad: true,
video: url, showProgress: false,
width: 500//384//256 subtitles: 'srt/' + id + '.srt',
timeline: timeline,
title: '<b>Brick</b> - Rian Johnson - 2005',
video: url + '?' + + Ox.random(1000000),
width: 360
})
.css({
margin: '16px'
}),
Ox.VideoPlayer({
height: 192,
'in': 3128.725,
//keepIconVisible: true,
out: 3130.725,
paused: true,
playInToOut: true,
//preload: 'none',
showIcon: true,
showIconOnLoad: true,
timeline: timeline,
video: url + '?' + + Ox.random(1000000),
width: 360
})
.css({
margin: '16px'
}),
Ox.VideoPlayer({
controls: ['play', 'playInToOut', 'mute', 'size', 'space', 'position'],
externalControls: true,
height: videoSize.height,
'in': 3128.725,
out: 3130.725,
paused: true,
showMilliseconds: 2,
subtitles: 'srt/' + id + '.srt',
timeline: timeline,
video: url + '?' + + Ox.random(1000000),
width: videoSize.width
})
.css({
margin: '16px'
})
];
window.$videos = $videos
Ox.SplitPanel({
elements: [
{
element: Ox.SplitPanel({
elements: [
{
element: Ox.Element()
.append($videos[0])
.bindEvent({
resize: function(foo, size) {
$videos[0].options({height: size - 32});
}
}),
size: 224,
resizable: true,
resize: [100, 400]
},
{
element: Ox.Element()
}
],
orientation: 'vertical'
})
.bindEvent({
resize: function(foo, size) {
$videos[0].options({width: size - 32});
}
}),
size: 392,
resizable: true,
resize: [200, 600]
},
{
element: Ox.Element()
.append($videos[1])
.bindEvent({
resize: resizeVideo
})
},
{
element: Ox.SplitPanel({
elements: [
{
element: Ox.Element()
.append($videos[2])
.bindEvent({
resize: function(foo, size) {
$videos[2].options({height: size - 48});
}
}),
size: 240,
resizable: true,
resize: [100, 400]
},
{
element: Ox.Element()
}
],
orientation: 'vertical'
})
.bindEvent({
resize: function(foo, size) {
$videos[2].options({width: size - 32});
}
}),
size: 392,
resizable: true,
resize: [200, 600]
}
],
orientation: 'horizontal'
}).appendTo(Ox.UI.$body); }).appendTo(Ox.UI.$body);
/*
var id = '0133093'; function getVideoSize() {
var url = 'http://next.0xdb.org/' + id + '/96p.webm?' + Ox.random(1000000); var size = {},
var timeline = 'http://next.0xdb.org/' + id + '/timeline.16.png'; widths = $videos ? $videos[0].options('width') + $videos[2].options('width') : 720
Ox.VideoPlayer({ size.width = window.innerWidth - widths - 98;
height: 96 * 256/230, size.height = Math.round(size.width / 180 * 96);
timeline: timeline, return size;
url: url, }
width: 256 function resizeVideo() {
}).css({ var size = getVideoSize();
left: '300px' $videos[1].options({
}).appendTo(Ox.UI.$body); width: size.width,
*/ height: size.height
});
}
}); });

View file

@ -1647,7 +1647,6 @@ Video
margin-left: 4px; margin-left: 4px;
} }
.OxVideoPlayer > .OxBar .OxInputGroup { .OxVideoPlayer > .OxBar .OxInputGroup {
//width: 98px; //width: 98px;
} }

File diff suppressed because it is too large Load diff

View file

@ -34,8 +34,13 @@ Ox.Tooltip = function(options, self) {
return that; return that;
}; };
// can pass event instead of x/y
that.show = function(x, y) { that.show = function(x, y) {
var left, top, width, height; var left, top, width, height;
if (arguments.length == 1) {
y = arguments[0].clientY;
x = arguments[0].clientX;
}
$('.OxTooltip').remove(); // fixme: don't use DOM $('.OxTooltip').remove(); // fixme: don't use DOM
that.appendTo(Ox.UI.$body); that.appendTo(Ox.UI.$body);
width = that.width(); width = that.width();

View file

@ -459,6 +459,12 @@ Video
background: rgb(48, 48, 48); background: rgb(48, 48, 48);
} }
.OxThemeModern .OxVideo.OxFocus {
-moz-box-shadow: 0 0 2px rgb(128, 128, 128);
-webkit-box-shadow: 0 0 2px rgb(128, 128, 128);
}
.OxThemeModern .OxVideoPlayer { .OxThemeModern .OxVideoPlayer {
background: rgb(0, 0, 0); background: rgb(0, 0, 0);
} }