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

Add setting for preferred video codec

This commit is contained in:
FintasticMan 2024-05-29 12:14:19 +02:00
parent ef6bbc8212
commit b234888485
No known key found for this signature in database
GPG key ID: A00F1AB6DB1ED386
5 changed files with 42 additions and 0 deletions

View file

@ -70,6 +70,21 @@ function getDeviceProfile(item) {
});
}
const preferredTranscodeVideoCodec = appSettings.preferredTranscodeVideoCodec();
if (preferredTranscodeVideoCodec) {
profile.TranscodingProfiles.forEach((transcodingProfile) => {
if (transcodingProfile.Type === 'Video') {
const videoCodecs = transcodingProfile.VideoCodec.split(',');
const index = videoCodecs.indexOf(preferredTranscodeVideoCodec);
if (index !== -1) {
videoCodecs.splice(index, 1);
videoCodecs.unshift(preferredTranscodeVideoCodec);
transcodingProfile.VideoCodec = videoCodecs.join(',');
}
}
});
}
const preferredTranscodeVideoAudioCodec = appSettings.preferredTranscodeVideoAudioCodec();
if (preferredTranscodeVideoAudioCodec) {
profile.TranscodingProfiles.forEach((transcodingProfile) => {