diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index b154e6e125..d372145d55 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -51,25 +51,25 @@ - + - + - + - + - + - + - + @@ -78,7 +78,7 @@ - +
diff --git a/dashboard-ui/musicvideos.html b/dashboard-ui/musicvideos.html index 87402ca89c..f5d7a95af8 100644 --- a/dashboard-ui/musicvideos.html +++ b/dashboard-ui/musicvideos.html @@ -50,22 +50,22 @@ - + - + - + - + - + - + @@ -74,7 +74,7 @@ - +
diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index bd8f9dc4ef..b566e22bf5 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -497,20 +497,28 @@ } } + // Webm must be ahead of mp4 due to the issue of mp4 playing too fast in chrome + var prioritizeWebmOverH264 = true; + + var h264Codec = 'h264'; + var h264AudioCodec = 'aac'; + + if (videoStream.Width && videoStream.Width <= baseParams.maxWidth) { + + var videoCodec = (videoStream.Codec || '').toLowerCase(); + + if (videoCodec.indexOf('h264') != -1) { + // h264Codec = 'copy'; + } + } + if (startPosition) { baseParams.StartTimeTicks = startPosition; } var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, { - videoCodec: 'h264', - audioCodec: 'aac', - profile: 'baseline', - level: 3 - })); - - var tsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.ts', $.extend({}, baseParams, { - videoCodec: 'h264', - audioCodec: 'aac', + videoCodec: h264Codec, + audioCodec: h264AudioCodec, profile: 'baseline', level: 3 })); @@ -521,8 +529,8 @@ })); var hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.m3u8', $.extend({}, baseParams, { - videoCodec: 'h264', - audioCodec: 'aac', + videoCodec: h264Codec, + audioCodec: h264AudioCodec, profile: 'baseline', level: 3 })); @@ -535,9 +543,6 @@ var html = ''; - // HLS must be at the top for safari - // Webm must be ahead of mp4 due to the issue of mp4 playing too fast in chrome - var requiresControls = $.browser.msie || $.browser.android || ($.browser.webkit && !$.browser.chrome); // Can't autoplay in these browsers so we need to use the full controls @@ -547,10 +552,19 @@ html += '