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:
parent
7a80749c6f
commit
6361f4bf1b
1 changed files with 30 additions and 45 deletions
|
@ -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){
|
||||||
|
|
||||||
profile.TranscodingProfiles.push({
|
if (supportedFormats.indexOf(audioFormat) != -1) {
|
||||||
Container: 'aac',
|
profile.TranscodingProfiles.push({
|
||||||
Type: 'Audio',
|
Container: audioFormat,
|
||||||
AudioCodec: 'aac',
|
Type: 'Audio',
|
||||||
Context: 'Streaming',
|
AudioCodec: audioFormat,
|
||||||
Protocol: 'http'
|
Context: 'Streaming',
|
||||||
});
|
Protocol: 'http'
|
||||||
|
});
|
||||||
profile.TranscodingProfiles.push({
|
profile.TranscodingProfiles.push({
|
||||||
Container: 'aac',
|
Container: audioFormat,
|
||||||
Type: 'Audio',
|
Type: 'Audio',
|
||||||
AudioCodec: 'aac',
|
AudioCodec: audioFormat,
|
||||||
Context: 'Static',
|
Context: 'Static',
|
||||||
Protocol: 'http'
|
Protocol: 'http'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else {
|
});
|
||||||
profile.TranscodingProfiles.push({
|
|
||||||
Container: 'mp3',
|
|
||||||
Type: 'Audio',
|
|
||||||
AudioCodec: 'mp3',
|
|
||||||
Context: 'Streaming',
|
|
||||||
Protocol: 'http'
|
|
||||||
});
|
|
||||||
profile.TranscodingProfiles.push({
|
|
||||||
Container: 'mp3',
|
|
||||||
Type: 'Audio',
|
|
||||||
AudioCodec: 'mp3',
|
|
||||||
Context: 'Static',
|
|
||||||
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');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue