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

update profile generation

This commit is contained in:
Luke Pulverenti 2015-11-20 22:04:46 -05:00
parent b78ef8cbe5
commit 9ebd025914

View file

@ -36,8 +36,6 @@
return targets; return targets;
}; };
var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, '');
self.getVideoQualityOptions = function (videoWidth, videoHeight) { self.getVideoQualityOptions = function (videoWidth, videoHeight) {
var bitrateSetting = AppSettings.maxStreamingBitrate(); var bitrateSetting = AppSettings.maxStreamingBitrate();
@ -129,6 +127,8 @@
var canPlayWebm = supportedFormats.indexOf('webm') != -1; var canPlayWebm = supportedFormats.indexOf('webm') != -1;
var canPlayAc3 = supportedFormats.indexOf('ac3') != -1; var canPlayAc3 = supportedFormats.indexOf('ac3') != -1;
var canPlayAac = supportedFormats.indexOf('aac') != -1;
var canPlayMp3 = supportedFormats.indexOf('mp3') != -1;
var profile = {}; var profile = {};
@ -143,7 +143,7 @@
Container: 'mp4,m4v', Container: 'mp4,m4v',
Type: 'Video', Type: 'Video',
VideoCodec: 'h264', VideoCodec: 'h264',
AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '') AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '')
}); });
} }
@ -152,7 +152,7 @@
Container: 'mkv,mov', Container: 'mkv,mov',
Type: 'Video', Type: 'Video',
VideoCodec: 'h264', VideoCodec: 'h264',
AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '') AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '')
}); });
} }
@ -165,10 +165,12 @@
}); });
} }
profile.DirectPlayProfiles.push({ if (canPlayMp3) {
Container: 'mp3', profile.DirectPlayProfiles.push({
Type: 'Audio' Container: 'mp3',
}); Type: 'Audio'
});
}
if (canPlayAac) { if (canPlayAac) {
profile.DirectPlayProfiles.push({ profile.DirectPlayProfiles.push({
@ -959,6 +961,9 @@
contentType = 'application/x-mpegURL'; contentType = 'application/x-mpegURL';
} else { } else {
// Reports of stuttering with h264 stream copy in IE
mediaUrl += '&EnableAutoStreamCopy=false';
startTimeTicksOffset = startPosition || 0; startTimeTicksOffset = startPosition || 0;
contentType = 'video/' + mediaSource.TranscodingContainer; contentType = 'video/' + mediaSource.TranscodingContainer;
} }
@ -1862,6 +1867,14 @@
if (canPlayH264) { if (canPlayH264) {
list.push('h264'); list.push('h264');
} }
if (document.createElement('audio').canPlayType('audio/aac').replace(/no/, '')) {
list.push('aac');
}
if (document.createElement('audio').canPlayType('audio/mp3').replace(/no/, '')) {
list.push('mp3');
}
supportedFormats = list; supportedFormats = list;
return list; return list;
} }