diff --git a/package-lock.json b/package-lock.json index 0780a8c51..94fc63081 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "git+ssh://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "git+ssh://git@github.com/Stremio/stremio-translations.git#9c91862cdf8f1f0fb54df870807cd6af18679a89", + "stremio-translations": "git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7", "url": "0.11.0", "use-long-press": "^3.1.5" }, @@ -12878,9 +12878,9 @@ } }, "node_modules/stremio-translations": { - "version": "1.44.1", - "resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#9c91862cdf8f1f0fb54df870807cd6af18679a89", - "integrity": "sha512-sOYmxXAVT5DwkIxFnateCQ+4rfe9xqWVTdnwc7Jdo7UCdnbtTUuHXIjyKFK2Vv11nWV5mBrizxAscdcxUpEImw==", + "version": "1.44.3", + "resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7", + "integrity": "sha512-E8UqbRzVQzDFQvKLTztrtA2V8xL8JeYfi+hI9IWx9kwIMQ34no2hxuualXH7A4U0s8xlM6BQW4bcQlVKwflhEg==", "license": "MIT" }, "node_modules/string_decoder": { @@ -24576,9 +24576,9 @@ "dev": true }, "stremio-translations": { - "version": "git+ssh://git@github.com/Stremio/stremio-translations.git#9c91862cdf8f1f0fb54df870807cd6af18679a89", - "integrity": "sha512-sOYmxXAVT5DwkIxFnateCQ+4rfe9xqWVTdnwc7Jdo7UCdnbtTUuHXIjyKFK2Vv11nWV5mBrizxAscdcxUpEImw==", - "from": "stremio-translations@git+ssh://git@github.com/Stremio/stremio-translations.git#9c91862cdf8f1f0fb54df870807cd6af18679a89" + "version": "git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7", + "integrity": "sha512-E8UqbRzVQzDFQvKLTztrtA2V8xL8JeYfi+hI9IWx9kwIMQ34no2hxuualXH7A4U0s8xlM6BQW4bcQlVKwflhEg==", + "from": "stremio-translations@git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7" }, "string_decoder": { "version": "1.1.1", diff --git a/package.json b/package.json index f04290e69..75791ca93 100755 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "git+ssh://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "git+ssh://git@github.com/Stremio/stremio-translations.git#9c91862cdf8f1f0fb54df870807cd6af18679a89", + "stremio-translations": "git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7", "url": "0.11.0", "use-long-press": "^3.1.5" }, diff --git a/src/routes/Player/Player.js b/src/routes/Player/Player.js index d2179740a..2b1c50aa9 100644 --- a/src/routes/Player/Player.js +++ b/src/routes/Player/Player.js @@ -27,11 +27,8 @@ const styles = require('./styles'); const Player = ({ urlParams, queryParams }) => { const { t } = useTranslation(); const { chromecast, shell, core } = useServices(); - const [forceTranscoding, maxAudioChannels] = React.useMemo(() => { - return [ - queryParams.has('forceTranscoding'), - queryParams.has('maxAudioChannels') ? parseInt(queryParams.get('maxAudioChannels'), 10) : null - ]; + const forceTranscoding = React.useMemo(() => { + return queryParams.has('forceTranscoding'); }, [queryParams]); const [player, videoParamsChanged, timeChanged, pausedChanged, ended, nextVideo] = usePlayer(urlParams); const [settings, updateSettings] = useSettings(); @@ -288,10 +285,7 @@ const Player = ({ urlParams, queryParams }) => { : 0, forceTranscoding: forceTranscoding || casting, - maxAudioChannels: typeof maxAudioChannels === 'number' ? - maxAudioChannels - : - null, + maxAudioChannels: settings.surroundSound ? 32 : 2, streamingServerURL: streamingServer.baseUrl.type === 'Ready' ? casting ? streamingServer.baseUrl.content @@ -306,7 +300,7 @@ const Player = ({ urlParams, queryParams }) => { shellTransport: shell.active ? shell.transport : null, }); } - }, [streamingServer.baseUrl, player.selected, player.metaItem, forceTranscoding, maxAudioChannels, casting]); + }, [streamingServer.baseUrl, player.selected, player.metaItem, forceTranscoding, casting]); React.useEffect(() => { if (videoState.stream !== null) { dispatch({ diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index 1baeb5511..225c66f35 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -34,6 +34,7 @@ const Settings = () => { subtitlesBackgroundColorInput, subtitlesOutlineColorInput, audioLanguageSelect, + surroundSoundCheckbox, seekTimeDurationSelect, seekShortTimeDurationSelect, escExitFullscreenCheckbox, @@ -405,6 +406,16 @@ const Settings = () => { {...audioLanguageSelect} /> +
+
+
{ t('SETTINGS_SURROUND_SOUND') }
+
+ +
diff --git a/src/routes/Settings/useProfileSettingsInputs.js b/src/routes/Settings/useProfileSettingsInputs.js index 2c2f39c88..64b1beb17 100644 --- a/src/routes/Settings/useProfileSettingsInputs.js +++ b/src/routes/Settings/useProfileSettingsInputs.js @@ -135,6 +135,21 @@ const useProfileSettingsInputs = (profile) => { }); } }), [profile.settings]); + const surroundSoundCheckbox = React.useMemo(() => ({ + checked: profile.settings.surroundSound, + onClick: () => { + core.transport.dispatch({ + action: 'Ctx', + args: { + action: 'UpdateSettings', + args: { + ...profile.settings, + surroundSound: !profile.settings.surroundSound + } + } + }); + } + }), [profile.settings]); const escExitFullscreenCheckbox = React.useMemo(() => ({ checked: profile.settings.escExitFullscreen, onClick: () => { @@ -307,6 +322,7 @@ const useProfileSettingsInputs = (profile) => { subtitlesBackgroundColorInput, subtitlesOutlineColorInput, audioLanguageSelect, + surroundSoundCheckbox, escExitFullscreenCheckbox, seekTimeDurationSelect, seekShortTimeDurationSelect, diff --git a/src/types/models/Ctx.d.ts b/src/types/models/Ctx.d.ts index 54ee1dc4e..15050b2a5 100644 --- a/src/types/models/Ctx.d.ts +++ b/src/types/models/Ctx.d.ts @@ -37,6 +37,7 @@ type Settings = { subtitlesOutlineColor: string, subtitlesSize: number, subtitlesTextColor: string, + surroundSound: boolean, }; type Profile = {