Merge pull request #453 from xicoivy/main

Trailer orientation
This commit is contained in:
Nayif 2026-02-01 01:02:58 +05:30 committed by GitHub
commit d6c3e81e5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -10,4 +10,5 @@ export const LOCALES = [
{ code: 'hr', key: 'croatian' },
{ code: 'zh-CN', key: 'chinese' },
{ code: 'hi', key: 'hindi' }
{ code: 'sr', key: 'serbian' }
];

View file

@ -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<TrailerContextValue | undefined>(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);
}, []);

View file

@ -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 }) =>