diff --git a/dashboard-ui/scripts/Extensions.js b/dashboard-ui/scripts/Extensions.js index 4e3fb3735a..aa5904e085 100644 --- a/dashboard-ui/scripts/Extensions.js +++ b/dashboard-ui/scripts/Extensions.js @@ -684,9 +684,14 @@ _V_.ChapterMenuItem = _V_.MenuItem.extend({ function ticks_to_human(str) { var in_seconds = (str / 10000000); - var hours = '0'+Math.floor(in_seconds/3600); + var hours = 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(":"); + var time = ''; + + if (hours > 0) time += hours+":"; + time += minutes.substr(-2) + ":" +seconds.substr(-2); + + return time; }; \ No newline at end of file diff --git a/dashboard-ui/scripts/MediaPlayer.js b/dashboard-ui/scripts/MediaPlayer.js index 400e4820c3..136d6204c1 100644 --- a/dashboard-ui/scripts/MediaPlayer.js +++ b/dashboard-ui/scripts/MediaPlayer.js @@ -258,7 +258,7 @@ var videoJSextension = { _V_.merge( _V_.ControlBar.prototype.options.components, { ResolutionSelectorButton : {} } ); //chceck if chapters exist and add chapter selector - if (item.Chapters.length > 0) { + if (item.Chapters && item.Chapters.length) { // Put together the videojs source arrays for each available chapter $.each( item.Chapters, function( i, chapter ) {