diff --git a/package.json b/package.json index 0c9ca54ec..a9a78e7bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "stremio", "displayName": "Stremio", - "version": "5.0.0-beta.29", + "version": "5.0.0-beta.30", "author": "Smart Code OOD", "private": true, "license": "gpl-2.0", @@ -41,7 +41,7 @@ "react-i18next": "^15.1.3", "react-is": "18.3.1", "spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "github:Stremio/stremio-translations#7c0c337f32163aa13158bb90cd6133da43feafef", + "stremio-translations": "github:Stremio/stremio-translations#1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe", "url": "0.11.4", "use-long-press": "^3.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 435a809e8..a55a4f3bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,8 +90,8 @@ importers: specifier: github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6 version: https://codeload.github.com/Stremio/spatial-navigation/tar.gz/64871b1422466f5f45d24ebc8bbd315b2ebab6a6 stremio-translations: - specifier: github:Stremio/stremio-translations#7c0c337f32163aa13158bb90cd6133da43feafef - version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/7c0c337f32163aa13158bb90cd6133da43feafef + specifier: github:Stremio/stremio-translations#1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe + version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe url: specifier: 0.11.4 version: 0.11.4 @@ -4133,8 +4133,8 @@ packages: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} - stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/7c0c337f32163aa13158bb90cd6133da43feafef: - resolution: {tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/7c0c337f32163aa13158bb90cd6133da43feafef} + stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe: + resolution: {tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe} version: 1.45.0 string-length@4.0.2: @@ -9378,7 +9378,7 @@ snapshots: es-errors: 1.3.0 internal-slot: 1.1.0 - stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/7c0c337f32163aa13158bb90cd6133da43feafef: {} + stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/1bfcb6d2a4f37bb647959ba0bbbd1ade1415c2fe: {} string-length@4.0.2: dependencies: diff --git a/src/App/styles.less b/src/App/styles.less index e6fd7d747..53ec4c1d5 100644 --- a/src/App/styles.less +++ b/src/App/styles.less @@ -23,8 +23,8 @@ // HTML sizes @html-width: ~"calc(max(var(--small-viewport-width), var(--dynamic-viewport-width)))"; @html-height: ~"calc(max(var(--small-viewport-height), var(--dynamic-viewport-height)))"; -@html-standalone-width: ~"calc(max(100%, var(--small-viewport-width)))"; -@html-standalone-height: ~"calc(max(100%, var(--small-viewport-height)))"; +@html-standalone-width: ~"calc(max(100%, var(--large-viewport-width)))"; +@html-standalone-height: ~"calc(max(100%, var(--large-viewport-height)))"; // Safe area insets @safe-area-inset-top: env(safe-area-inset-top, 0rem); @@ -156,6 +156,7 @@ html { overscroll-behavior: none; user-select: none; touch-action: manipulation; + background-color: var(--primary-background-color); -webkit-tap-highlight-color: transparent; @media (display-mode: standalone) { diff --git a/src/common/Platform/Platform.tsx b/src/common/Platform/Platform.tsx index 0da1881ef..86ca999c6 100644 --- a/src/common/Platform/Platform.tsx +++ b/src/common/Platform/Platform.tsx @@ -18,7 +18,9 @@ const PlatformProvider = ({ children }: Props) => { const openExternal = (url: string) => { try { const { hostname } = new URL(url); - const isWhitelisted = WHITELISTED_HOSTS.some((host: string) => hostname.endsWith(host)); + const isWhitelisted = WHITELISTED_HOSTS.some((host: string) => + hostname === host || hostname.endsWith('.' + host) + ); const finalUrl = !isWhitelisted ? `https://www.stremio.com/warning#${encodeURIComponent(url)}` : url; window.open(finalUrl, '_blank'); diff --git a/src/common/Shortcuts/shortcuts.json b/src/common/Shortcuts/shortcuts.json index a3ac0f8fe..31333d72f 100644 --- a/src/common/Shortcuts/shortcuts.json +++ b/src/common/Shortcuts/shortcuts.json @@ -74,6 +74,11 @@ "label": "SETTINGS_SHORTCUT_SUBTITLES_DELAY", "combos": [["G"], ["H"]] }, + { + "name": "toggleSubtitles", + "label": "SETTINGS_SHORTCUT_TOGGLE_SUBTITLES", + "combos": [["C"]] + }, { "name": "subtitlesMenu", "label": "SETTINGS_SHORTCUT_MENU_SUBTITLES", diff --git a/src/components/Image/Image.tsx b/src/components/Image/Image.tsx index e64078fbc..5c7a93c00 100644 --- a/src/components/Image/Image.tsx +++ b/src/components/Image/Image.tsx @@ -7,7 +7,7 @@ type Props = { src: string, alt: string, fallbackSrc: string, - renderFallback: () => void, + renderFallback: () => React.ReactNode, onError: (event: React.SyntheticEvent) => void, }; diff --git a/src/components/MetaPreview/MetaLinks/MetaLinks.js b/src/components/MetaPreview/MetaLinks/MetaLinks.js index 3be090911..6e58a5d1e 100644 --- a/src/components/MetaPreview/MetaLinks/MetaLinks.js +++ b/src/components/MetaPreview/MetaLinks/MetaLinks.js @@ -14,7 +14,7 @@ const MetaLinks = ({ className, label, links }) => { { typeof label === 'string' && label.length > 0 ?
- { stringWithPrefix(label.toUpperCase(), 'LINKS') } + { stringWithPrefix(label.toUpperCase(), 'LINKS_') }
: null diff --git a/src/index.html b/src/index.html index ff8166004..def81fd71 100644 --- a/src/index.html +++ b/src/index.html @@ -5,6 +5,7 @@ + diff --git a/src/routes/Intro/Intro.js b/src/routes/Intro/Intro.js index 5a2f80aaa..1f041c004 100644 --- a/src/routes/Intro/Intro.js +++ b/src/routes/Intro/Intro.js @@ -183,7 +183,7 @@ const Intro = ({ queryParams }) => { return; } if (!state.privacyPolicyAccepted) { - dispatch({ type: 'error', error: 'You must accept the Privacy Policy' }); + dispatch({ type: 'error', error: t('MUST_ACCEPT_PRIVACY_POLICY') }); return; } openLoaderModal(); diff --git a/src/routes/Intro/PasswordResetModal/PasswordResetModal.js b/src/routes/Intro/PasswordResetModal/PasswordResetModal.js index 8c69c1489..497568cc9 100644 --- a/src/routes/Intro/PasswordResetModal/PasswordResetModal.js +++ b/src/routes/Intro/PasswordResetModal/PasswordResetModal.js @@ -19,7 +19,7 @@ const PasswordResetModal = ({ email, onCloseRequest }) => { emailRef.current.value.length > 0 && emailRef.current.validity.valid ? platform.openExternal('https://www.strem.io/reset-password/' + emailRef.current.value, '_blank') : - setError('Invalid email'); + setError(t('INVALID_EMAIL')); }, []); const passwordResetModalButtons = React.useMemo(() => { return [ @@ -31,7 +31,7 @@ const PasswordResetModal = ({ email, onCloseRequest }) => { } }, { - label: t('SEND'), + label: t('BUTTON_SEND'), props: { onClick: goToPasswordReset } @@ -52,7 +52,7 @@ const PasswordResetModal = ({ email, onCloseRequest }) => { ref={emailRef} className={styles['credentials-text-input']} type={'email'} - placeholder={'Email'} + placeholder={t('EMAIL')} defaultValue={typeof email === 'string' ? email : ''} onChange={emailOnChange} onSubmit={goToPasswordReset} diff --git a/src/routes/Player/Player.js b/src/routes/Player/Player.js index 196bb813b..54ad14bc8 100644 --- a/src/routes/Player/Player.js +++ b/src/routes/Player/Player.js @@ -90,6 +90,7 @@ const Player = ({ urlParams, queryParams }) => { const nextVideoPopupDismissed = React.useRef(false); const defaultSubtitlesSelected = React.useRef(false); + const subtitlesEnabled = React.useRef(true); const defaultAudioTrackSelected = React.useRef(false); const [error, setError] = React.useState(null); @@ -670,6 +671,19 @@ const Player = ({ urlParams, queryParams }) => { combo === 1 ? onUpdateSubtitlesSize(-1) : onUpdateSubtitlesSize(1); }, [onUpdateSubtitlesSize, onUpdateSubtitlesSize]); + onShortcut('toggleSubtitles', () => { + const savedTrack = player.streamState?.subtitleTrack; + + if (subtitlesEnabled.current) { + video.setSubtitlesTrack(null); + video.setExtraSubtitlesTrack(null); + } else if (savedTrack?.id) { + savedTrack.embedded ? video.setSubtitlesTrack(savedTrack.id) : video.setExtraSubtitlesTrack(savedTrack.id); + } + + subtitlesEnabled.current = !subtitlesEnabled.current; + }, [player.streamState]); + onShortcut('subtitlesMenu', () => { closeMenus(); if (video.state?.subtitlesTracks?.length > 0 || video.state?.extraSubtitlesTracks?.length > 0) { diff --git a/src/routes/Player/SideDrawer/SideDrawer.less b/src/routes/Player/SideDrawer/SideDrawer.less index 0fe22f58a..e6831a71d 100644 --- a/src/routes/Player/SideDrawer/SideDrawer.less +++ b/src/routes/Player/SideDrawer/SideDrawer.less @@ -3,6 +3,7 @@ @import (reference) '~stremio/common/screen-sizes.less'; :import('~stremio/components/MetaPreview/styles.less') { + description-container: description-container; action-buttons-container: action-buttons-container; } @@ -12,6 +13,7 @@ display: flex; flex-direction: column; padding: @padding; + padding-top: calc(@padding + var(--safe-area-inset-top)); height: 100dvh; max-width: 35rem; overflow-y: auto; @@ -27,7 +29,7 @@ .close-button { display: none; position: absolute; - top: 1.3rem; + top: calc(1.3rem + var(--safe-area-inset-top)); right: 1.3rem; padding: 0.5rem; background-color: transparent; @@ -57,9 +59,14 @@ .info { padding: @padding; overflow-y: auto; - flex: 1; .side-drawer-meta-preview { + .description-container { + display: -webkit-box; + -webkit-line-clamp: 4; + -webkit-box-orient: vertical; + } + .action-buttons-container { padding-top: 0; margin-top: 0; @@ -91,10 +98,6 @@ @media @phone-landscape { .side-drawer { max-width: 50dvw; - - .info { - flex: 1; - } } }