diff --git a/src/constants/locales.ts b/src/constants/locales.ts index a1370055..716c41d9 100644 --- a/src/constants/locales.ts +++ b/src/constants/locales.ts @@ -10,4 +10,5 @@ export const LOCALES = [ { code: 'hr', key: 'croatian' }, { code: 'zh-CN', key: 'chinese' }, { code: 'hi', key: 'hindi' } + { code: 'sr', key: 'serbian' } ]; \ No newline at end of file diff --git a/src/contexts/TrailerContext.tsx b/src/contexts/TrailerContext.tsx index 53c1438d..c0482b1b 100644 --- a/src/contexts/TrailerContext.tsx +++ b/src/contexts/TrailerContext.tsx @@ -1,3 +1,5 @@ +import * as ScreenOrientation from 'expo-screen-orientation'; + import React, { createContext, useContext, useState, useCallback, useMemo, ReactNode } from 'react'; interface TrailerContextValue { @@ -12,6 +14,17 @@ const TrailerContext = createContext(undefined) export const TrailerProvider: React.FC<{ children: ReactNode }> = ({ children }) => { const [isTrailerPlaying, setIsTrailerPlaying] = useState(true); + React.useEffect(() => { + async function handleRotation() { + if (isTrailerPlaying) { + await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE); + } else { + await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP); + } + } + handleRotation(); + }, [isTrailerPlaying]); + const pauseTrailer = useCallback(() => { setIsTrailerPlaying(false); }, []); diff --git a/src/screens/TMDBSettingsScreen.tsx b/src/screens/TMDBSettingsScreen.tsx index b96a92cf..029ae8af 100644 --- a/src/screens/TMDBSettingsScreen.tsx +++ b/src/screens/TMDBSettingsScreen.tsx @@ -1175,6 +1175,8 @@ const TMDBSettingsScreen = () => { { code: 'uk', label: 'Українська', native: 'Ukrainian' }, { code: 'vi', label: 'Tiếng Việt', native: 'Vietnamese' }, { code: 'th', label: 'ไทย', native: 'Thai' }, + { code: 'hr', +label: 'Hrvatski', native: 'Croatian' }, ]; const filteredLanguages = languages.filter(({ label, code, native }) =>