diff --git a/static/js/jquery/jquery.videosupport.js b/static/js/jquery/jquery.videosupport.js index 01197b84..0690f607 100644 --- a/static/js/jquery/jquery.videosupport.js +++ b/static/js/jquery/jquery.videosupport.js @@ -14,6 +14,15 @@ jQuery.support.video = function() { } else { video.support = false; } + video.supportedFormat = function(formats) { + var format; + formats.forEach(function(f) { + if(!format && video[f]) { + format = f + } + }); + return format; + } return video; }(); diff --git a/static/js/pandora.js b/static/js/pandora.js index e2314277..edd7c6ac 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -1737,7 +1737,7 @@ } else if (app.user.ui.itemView == 'player') { var video = result.data.item.stream, subtitles = result.data.item.layers.subtitles, - format = Ox.supportedVideoFormat(video.formats); + format = $.support.video.supportedFormat(video.formats); video.height = video.profiles[0] video.width = parseInt(video.height * video.aspectRatio / 2) * 2; video.url = video.baseUrl + '/' + video.height + 'p.' + format; @@ -1774,7 +1774,7 @@ var layers = [], video = result.data.item.stream, cuts = result.data.item.cuts || {}, - format = Ox.supportedVideoFormat(video.formats), + format = $.support.video.supportedFormat(video.formats); subtitles = result.data.item.layers.subtitles; video.height = video.profiles[0]; video.width = parseInt(video.height * video.aspectRatio / 2) * 2;