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

fixes #1290 - upgrade audio formats

This commit is contained in:
Luke 2015-12-24 13:43:45 -05:00 committed by Luke Pulverenti
parent 7a80749c6f
commit 6361f4bf1b

View file

@ -129,6 +129,7 @@
var canPlayAc3 = supportedFormats.indexOf('ac3') != -1; var canPlayAc3 = supportedFormats.indexOf('ac3') != -1;
var canPlayAac = supportedFormats.indexOf('aac') != -1; var canPlayAac = supportedFormats.indexOf('aac') != -1;
var canPlayMp3 = supportedFormats.indexOf('mp3') != -1; var canPlayMp3 = supportedFormats.indexOf('mp3') != -1;
var canPlayOpus = supportedFormats.indexOf('opus') != -1;
var canPlayMkv = supportedFormats.indexOf('mkv') != -1; var canPlayMkv = supportedFormats.indexOf('mkv') != -1;
var profile = {}; var profile = {};
@ -166,19 +167,15 @@
}); });
} }
if (canPlayMp3) { ['opus', 'mp3', 'aac'].forEach(function(audioFormat){
profile.DirectPlayProfiles.push({
Container: 'mp3',
Type: 'Audio'
});
}
if (canPlayAac) { if (supportedFormats.indexOf(audioFormat) != -1) {
profile.DirectPlayProfiles.push({ profile.DirectPlayProfiles.push({
Container: 'aac', Container: audioFormat,
Type: 'Audio' Type: 'Audio'
}); });
} }
});
var directPlayAudioContainers = AppInfo.directPlayAudioContainers; var directPlayAudioContainers = AppInfo.directPlayAudioContainers;
@ -264,40 +261,25 @@
Protocol: 'http' Protocol: 'http'
}); });
if (canPlayAac && browserInfo.safari) { ['opus', 'mp3', 'aac'].forEach(function(audioFormat){
if (supportedFormats.indexOf(audioFormat) != -1) {
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'aac', Container: audioFormat,
Type: 'Audio', Type: 'Audio',
AudioCodec: 'aac', AudioCodec: audioFormat,
Context: 'Streaming',
Protocol: 'http'
});
profile.TranscodingProfiles.push({
Container: 'aac',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Static',
Protocol: 'http'
});
} else {
profile.TranscodingProfiles.push({
Container: 'mp3',
Type: 'Audio',
AudioCodec: 'mp3',
Context: 'Streaming', Context: 'Streaming',
Protocol: 'http' Protocol: 'http'
}); });
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'mp3', Container: audioFormat,
Type: 'Audio', Type: 'Audio',
AudioCodec: 'mp3', AudioCodec: audioFormat,
Context: 'Static', Context: 'Static',
Protocol: 'http' Protocol: 'http'
}); });
} }
});
profile.ContainerProfiles = []; profile.ContainerProfiles = [];
@ -1918,6 +1900,9 @@
if (document.createElement('audio').canPlayType('audio/mp3').replace(/no/, '')) { if (document.createElement('audio').canPlayType('audio/mp3').replace(/no/, '')) {
list.push('mp3'); list.push('mp3');
} }
if (document.createElement('audio').canPlayType('audio/opus').replace(/no/, '')) {
list.push('opus');
}
if (browserInfo.chrome) { if (browserInfo.chrome) {
list.push('mkv'); list.push('mkv');