1
0
Fork 0
forked from 0x2620/oxjs

video chapter titles

This commit is contained in:
rolux 2014-02-08 07:39:10 +00:00
commit 74101b1e22
2 changed files with 10 additions and 7 deletions

View file

@ -1401,12 +1401,14 @@ Ox.VideoPlayer = function(options, self) {
function getChapterTitle() {
var chapterTitle = '';
self.options.chapters && Ox.forEach(self.options.chapters, function(v) {
self.options.chapters && Ox.forEach(self.options.chapters, function(v, i) {
if (
v['in'] <= self.options.position
&& v.out >= self.options.position
v.position <= self.options.position && (
i == self.options.chapters.length - 1
|| self.options.chapters[i + 1].position >= self.options.position
)
) {
chapterTitle = v.text;
chapterTitle = v.title;
return false; // break
}
});
@ -1664,7 +1666,7 @@ Ox.VideoPlayer = function(options, self) {
return (self.options.fullscreen ? window.innerWidth : self.options.width) -
self.options.controlsTop.reduce(function(prev, curr) {
return prev + (
curr == 'title' || curr == 'space' ? 0
curr == 'title' || curr == 'chapterTitle' || curr == 'space' ? 0
: Ox.startsWith(curr, 'space') ? parseInt(curr.substr(5))
: 16
);
@ -2245,6 +2247,7 @@ Ox.VideoPlayer = function(options, self) {
setSize(self.$subtitle, getCSS('subtitle'), animate);
setSize(self.$controlsTop, getCSS('controlsTop'), animate);
setSize(self.$title, getCSS('title'), animate);
setSize(self.$chapterTitle, getCSS('title'), animate);
setSize(self.$spaceTop, getCSS('spaceTop'), animate);
setSize(self.$controlsBottom, getCSS('controlsBottom'), animate);
setSize(self.$timeline, getCSS('timeline'), animate, function() {