get supported format

This commit is contained in:
j 2011-02-11 15:50:41 +05:30
parent d4a82c8a08
commit 45e530763b
2 changed files with 11 additions and 2 deletions

View file

@ -14,6 +14,15 @@ jQuery.support.video = function() {
} else { } else {
video.support = false; video.support = false;
} }
video.supportedFormat = function(formats) {
var format;
formats.forEach(function(f) {
if(!format && video[f]) {
format = f
}
});
return format;
}
return video; return video;
}(); }();

View file

@ -1737,7 +1737,7 @@
} else if (app.user.ui.itemView == 'player') { } else if (app.user.ui.itemView == 'player') {
var video = result.data.item.stream, var video = result.data.item.stream,
subtitles = result.data.item.layers.subtitles, subtitles = result.data.item.layers.subtitles,
format = Ox.supportedVideoFormat(video.formats); format = $.support.video.supportedFormat(video.formats);
video.height = video.profiles[0] video.height = video.profiles[0]
video.width = parseInt(video.height * video.aspectRatio / 2) * 2; video.width = parseInt(video.height * video.aspectRatio / 2) * 2;
video.url = video.baseUrl + '/' + video.height + 'p.' + format; video.url = video.baseUrl + '/' + video.height + 'p.' + format;
@ -1774,7 +1774,7 @@
var layers = [], var layers = [],
video = result.data.item.stream, video = result.data.item.stream,
cuts = result.data.item.cuts || {}, cuts = result.data.item.cuts || {},
format = Ox.supportedVideoFormat(video.formats), format = $.support.video.supportedFormat(video.formats);
subtitles = result.data.item.layers.subtitles; subtitles = result.data.item.layers.subtitles;
video.height = video.profiles[0]; video.height = video.profiles[0];
video.width = parseInt(video.height * video.aspectRatio / 2) * 2; video.width = parseInt(video.height * video.aspectRatio / 2) * 2;