diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index c66fee35d2..ef9f305e0c 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -837,6 +837,20 @@ progress { background: none !important; } +.vjs-chapter-button div { + background-position: -100px -75px !important; +} +.vjs-chapter-button.vjs-menu-button ul { + width: auto; + max-width: 25em; + overflow-y: scroll; +} +.vjs-chapter-button.vjs-menu-button ul li { + width: auto; + white-space: nowrap; + font-size: 1.1em; +} + @media all and (min-width: 650px) { .itemVideo { diff --git a/dashboard-ui/scripts/Extensions.js b/dashboard-ui/scripts/Extensions.js index 6d8756c3c9..6a663e3af1 100644 --- a/dashboard-ui/scripts/Extensions.js +++ b/dashboard-ui/scripts/Extensions.js @@ -680,3 +680,13 @@ _V_.ChapterMenuItem = _V_.MenuItem.extend({ } }); +//convert Ticks to human hr:min:sec format +function ticks_to_human(str) { + + var in_seconds = (str / 10000000); + var hours = '0'+Math.floor(in_seconds/3600); + var minutes = '0'+Math.floor((in_seconds-(hours*3600))/60); + var seconds = '0'+Math.round(in_seconds-(hours*3600)-(minutes*60)); + + return [hours.substr(-2),minutes.substr(-2),seconds.substr(-2)].join(":"); +}; \ No newline at end of file diff --git a/dashboard-ui/scripts/MediaPlayer.js b/dashboard-ui/scripts/MediaPlayer.js index 4bdda3b535..e3a67a622c 100644 --- a/dashboard-ui/scripts/MediaPlayer.js +++ b/dashboard-ui/scripts/MediaPlayer.js @@ -169,6 +169,14 @@ videoJSextension.setup_video( $( '#videoWindow' ), item ); + (this).addEvent("loadstart",function(){ + $(".vjs-remaining-time-display").hide(); + }); + + (this).addEvent("durationchange",function(){ + if ((this).duration() != "Infinity") + $(".vjs-remaining-time-display").show(); + }); }); return $('video', nowPlayingBar)[0]; @@ -243,7 +251,7 @@ var videoJSextension = { vjs_chapters[i] = []; vjs_chapter = {}; - vjs_chapter.Name = chapter.Name; + vjs_chapter.Name = chapter.Name + " (" + ticks_to_human(chapter.StartPositionTicks) + ")"; vjs_chapter.StartPositionTicks = chapter.StartPositionTicks; vjs_chapter.vid_id = vid_id;