1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update h264 detection

This commit is contained in:
Luke Pulverenti 2016-01-04 16:13:33 -05:00
parent 4212cde734
commit fd9fd17abc

View file

@ -1789,16 +1789,8 @@
} }
function canPlayH264() { function canPlayH264() {
var v = document.createElement('video');
var userAgent = navigator.userAgent.toLowerCase(); return !!(v.canPlayType && v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
if (userAgent.indexOf('firefox') != -1) {
if (userAgent.indexOf('windows') != -1) {
return true;
}
return false;
}
return true;
} }
var supportedFormats; var supportedFormats;
@ -1818,13 +1810,7 @@
list.push('ac3'); list.push('ac3');
} }
var canPlayH264 = true; if (canPlayH264()) {
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('firefox') != -1 && userAgent.indexOf('windows') == -1) {
canPlayH264 = false;
}
if (canPlayH264) {
list.push('h264'); list.push('h264');
} }