timeline view: make in and out players display an image, not a video

This commit is contained in:
rolux 2010-09-18 12:50:08 +00:00
parent 50b92ebad5
commit e8e8be5b6d

View file

@ -9482,6 +9482,7 @@ requires
cuts: [], cuts: [],
duration: 0, duration: 0,
find: '', find: '',
frameURL: function() {},
largeTimeline: true, largeTimeline: true,
matches: [], matches: [],
points: [0, 0], points: [0, 0],
@ -9518,7 +9519,7 @@ requires
posterFrame: self.options.posterFrame, posterFrame: self.options.posterFrame,
subtitles: self.options.subtitles, subtitles: self.options.subtitles,
type: type, type: type,
url: self.options.videoURL, url: type == 'play' ? self.options.videoURL : self.options.frameURL,
width: self.sizes.player[i].width width: self.sizes.player[i].width
}) })
.css({ .css({
@ -9917,24 +9918,26 @@ requires
self.controlsHeight = 16; self.controlsHeight = 16;
if (self.options.type == 'play') {
self.$video = $('<video>') self.$video = $('<video>')
.attr({ .attr({
preload: 'auto' preload: 'auto',
src: self.options.url
}) })
.css({ .css({
height: self.options.height + 'px', height: self.options.height + 'px',
width: self.options.width + 'px' width: self.options.width + 'px'
}) })
.appendTo(that.$element); .appendTo(that.$element);
self.video = self.$video[0]; self.video = self.$video[0];
} else {
// fixme: can be removed once in and out players only display stills self.$video = $('<img>')
var other = $('video[src='+self.options.url+']')[0]; .css({
if (self.video.mozLoadFrom && other) height: self.options.height + 'px',
self.video.mozLoadFrom(other); width: self.options.width + 'px'
else })
self.video.src = self.options.url; .appendTo(that.$element)
}
self.$subtitle = $('<div>') self.$subtitle = $('<div>')
.addClass('OxSubtitle') .addClass('OxSubtitle')
@ -10089,17 +10092,20 @@ requires
}).addClass('foo'); }).addClass('foo');
}); });
if (self.options.type == 'play') {
self.$loadingIcon = new Ox.LoadingIcon() self.$loadingIcon = new Ox.LoadingIcon()
.appendTo(that) .appendTo(that)
.start(); .start();
self.loadingInterval = setInterval(function() {
self.loadInterval = setInterval(function() {
if (self.video.readyState) { if (self.video.readyState) {
clearInterval(self.loadInterval); clearInterval(self.loadingInterval);
self.$loadingIcon.stop(); self.$loadingIcon.stop();
setPosition(); setPosition();
} }
}, 50); }, 50);
} else {
setPosition();
}
function getSubtitle() { function getSubtitle() {
var subtitle = ''; var subtitle = '';
@ -10166,7 +10172,19 @@ requires
} }
function setPosition() { function setPosition() {
if (self.options.type == 'play') {
self.video.currentTime = self.options.position; self.video.currentTime = self.options.position;
} else {
self.$loadingIcon = new Ox.LoadingIcon()
.appendTo(that)
.start();
self.$video.attr({
src: self.options.url(self.options.position)
})
.one('load', function() {
self.$loadingIcon.stop();
});
}
setMarkers(); setMarkers();
setSubtitle(); setSubtitle();
self.$positionInput.options({ self.$positionInput.options({