forked from 0x2620/oxjs
video editor improvements
This commit is contained in:
parent
f8ec3fccf4
commit
a1deb20f97
8 changed files with 89 additions and 50 deletions
|
|
@ -306,8 +306,6 @@ Ox.VideoPlayer = function(options, self) {
|
|||
|
||||
loadImage();
|
||||
|
||||
self.options[self.options.type] = self.options.position;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -407,11 +405,14 @@ Ox.VideoPlayer = function(options, self) {
|
|||
src: Ox.UI.PATH + 'png/videoMarker' + titleCase + '.png'
|
||||
})
|
||||
.appendTo(self.$videoContainer);
|
||||
/*
|
||||
if (self.options.points[i] == self.options.position) {
|
||||
self.$pointMarker[point][edge].show();
|
||||
// fixme: there's a bug in jquery and/or webkit
|
||||
// normally, setMarker() should properly .show()
|
||||
// the in markers of the in player
|
||||
// or the out markers of the out player,
|
||||
// but only setting css display seems to work
|
||||
if (self.options.type == point) {
|
||||
self.$pointMarker[point][edge].css({display: 'block'});
|
||||
}
|
||||
*/
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -903,7 +904,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (self.options.enableVolume) {
|
||||
if (self.options.enableVolume || true) { // fixme
|
||||
|
||||
self.$volume = $('<div>')
|
||||
.addClass('OxControls OxVolume')
|
||||
|
|
@ -961,6 +962,8 @@ Ox.VideoPlayer = function(options, self) {
|
|||
|
||||
}
|
||||
|
||||
self.options.type != 'play' && self.options.showMarkers && setMarkers();
|
||||
|
||||
self.results = [];
|
||||
if (self.options.subtitles) {
|
||||
if (Ox.isArray(self.options.subtitles)) {
|
||||
|
|
@ -1386,6 +1389,10 @@ Ox.VideoPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function isEqual(a, b) {
|
||||
return Math.abs(a - b) < 0.001;
|
||||
}
|
||||
|
||||
function loadImage() {
|
||||
self.$video
|
||||
.one({
|
||||
|
|
@ -1395,7 +1402,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
})
|
||||
.attr({
|
||||
src: self.options.video(self.options.position)
|
||||
src: self.options.video(self.options.position, self.options.width)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1535,13 +1542,15 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function setMarkers() {
|
||||
//Ox.print('SET MARKERS', self.options.position, self.options['in'], self.options.out, self.$pointMarker);
|
||||
Ox.forEach(self.$posterMarker, function(marker) {
|
||||
self.options.position == self.options.posterFrame ?
|
||||
isEqual(self.options.position, self.options.posterFrame) ?
|
||||
marker.show() : marker.hide();
|
||||
});
|
||||
Ox.forEach(self.$pointMarker, function(markers, point) {
|
||||
Ox.forEach(markers, function(marker) {
|
||||
self.options.position == self.options[point] ?
|
||||
//Ox.print(self.options.position, self.options[point], isEqual(self.options.position, self.options[point]))
|
||||
isEqual(self.options.position, self.options[point]) ?
|
||||
marker.show() : marker.hide();
|
||||
});
|
||||
});
|
||||
|
|
@ -1994,12 +2003,16 @@ Ox.VideoPlayer = function(options, self) {
|
|||
toggleFullscreen();
|
||||
} else if (key == 'height' || key == 'width') {
|
||||
setSizes();
|
||||
} else if (key == 'in' || key == 'out') {
|
||||
self.options.paused && setMarkers();
|
||||
} else if (key == 'muted') {
|
||||
toggleMuted();
|
||||
} else if (key == 'paused') {
|
||||
togglePaused();
|
||||
} else if (key == 'position') {
|
||||
setPosition(value);
|
||||
} else if (key == 'posterFrame') {
|
||||
self.options.paused && setMarkers();
|
||||
} else if (key == 'scaleToFill') {
|
||||
toggleScale();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue