From a3c0fb05c37a0ca9d85b532f55f1b0b289b27882 Mon Sep 17 00:00:00 2001 From: GeorgeH005 <72687949+GeorgeH005@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:43:53 -0400 Subject: [PATCH] Backport pull request #5553 from jellyfin-web/release-10.9.z Fix Dolby Vision playback on webOS Original-merge: 86ff77924edd868c8350be3f0376bbfa8cd11d67 Merged-by: thornbill Backported-by: Bill Thornton --- src/scripts/browserDeviceProfile.js | 17 ++++++++++------- src/scripts/settings/userSettings.js | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index b1ad2cc2ad..4bda92547d 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -247,9 +247,13 @@ function supportedDolbyVisionProfilesHevc(videoTestElement) { .replace(/no/, '')) { supportedProfiles.push(5); } - if (videoTestElement - .canPlayType('video/mp4; codecs="dvh1.08.09"') - .replace(/no/, '')) { + if ( + videoTestElement + .canPlayType('video/mp4; codecs="dvh1.08.09"') + .replace(/no/, '') + // LG TVs from at least 2020 onwards should support profile 8, but they don't report it. + || (browser.web0sVersion >= 4) + ) { supportedProfiles.push(8); } } @@ -1259,17 +1263,16 @@ export default function (options) { }); if (browser.web0s && supportsDolbyVision(options)) { - // Disallow direct playing of DOVI media in containers not mp4. - // This paired with the "Prefer fMP4-HLS Container" client playback setting enables DOVI playback on webOS. + // Disallow direct playing of DOVI media in containers not ts or mp4. profile.CodecProfiles.push({ Type: 'Video', - Container: '-mp4', + Container: '-mp4,ts', Codec: 'hevc', Conditions: [ { Condition: 'EqualsAny', Property: 'VideoRangeType', - Value: 'SDR|HDR10|HLG', + Value: hevcVideoRangeTypes.split('|').filter((v) => !v.startsWith('DOVI')).join('|'), IsRequired: false } ] diff --git a/src/scripts/settings/userSettings.js b/src/scripts/settings/userSettings.js index ddfb8e8194..f83f313415 100644 --- a/src/scripts/settings/userSettings.js +++ b/src/scripts/settings/userSettings.js @@ -1,7 +1,7 @@ -import appSettings from './appSettings'; -import browser from '../browser'; import Events from '../../utils/events.ts'; import { toBoolean } from '../../utils/string.ts'; +import browser from '../browser'; +import appSettings from './appSettings'; function onSaveTimeout() { const self = this; @@ -142,7 +142,7 @@ export class UserSettings { } // Enable it by default only for the platforms that play fMP4 for sure. - return toBoolean(this.get('preferFmp4HlsContainer', false), browser.safari || browser.firefox || browser.chrome || browser.edgeChromium); + return toBoolean(this.get('preferFmp4HlsContainer', false), browser.safari || browser.firefox || (browser.chrome && !browser.web0s && !browser.tizen) || browser.edgeChromium); } /**