oxspeed/js/ui/videoPlayer.js

44 lines
1.3 KiB
JavaScript

pandora.ui.videoPlayer = function(options) {
// var url = options.url;
console.log(options.url);
var timeline = options.timeline || "foo.png"; //FIXME
var that = pandora.$ui.videoPlayer = Ox.VideoPlayer({
video: [options.url],
//video: ["/oxspeed/jaaga.webm"],
controlsTop: ['fullscreen'],
controlsBottom: ['play', 'volume', 'scale', 'timeline', 'position'],
height: 300,
width: 400,
showControlsOnLoad: true,
duration: 35, //FIXME
paused: true,
timeline: options.timeline || 'foo.png', //FIXME
title: options.title,
enableTimeline: true,
enableKeyboard: true,
enableMouse: true,
externalControls: false
// enableTimeline: true
})
.bindEvent({
"position": setPosition,
'playing': setPosition
});
that.seek = function(by) {
var position = that.options("position");
var newPosition = position + by;
that.options("position", newPosition);
//setPosition({'position': newPosition});
};
function setPosition(data) {
//var position = pandora.$ui.videoPlayer.options("position");
pandora.$ui.annotationsPanel.options("position", data.position);
};
//that.videoName = options.name;
return that;
};