mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-20 01:37:36 +00:00
commit
d6c3e81e5c
3 changed files with 16 additions and 0 deletions
|
|
@ -10,4 +10,5 @@ export const LOCALES = [
|
||||||
{ code: 'hr', key: 'croatian' },
|
{ code: 'hr', key: 'croatian' },
|
||||||
{ code: 'zh-CN', key: 'chinese' },
|
{ code: 'zh-CN', key: 'chinese' },
|
||||||
{ code: 'hi', key: 'hindi' }
|
{ code: 'hi', key: 'hindi' }
|
||||||
|
{ code: 'sr', key: 'serbian' }
|
||||||
];
|
];
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import * as ScreenOrientation from 'expo-screen-orientation';
|
||||||
|
|
||||||
import React, { createContext, useContext, useState, useCallback, useMemo, ReactNode } from 'react';
|
import React, { createContext, useContext, useState, useCallback, useMemo, ReactNode } from 'react';
|
||||||
|
|
||||||
interface TrailerContextValue {
|
interface TrailerContextValue {
|
||||||
|
|
@ -12,6 +14,17 @@ const TrailerContext = createContext<TrailerContextValue | undefined>(undefined)
|
||||||
export const TrailerProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
|
export const TrailerProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
|
||||||
const [isTrailerPlaying, setIsTrailerPlaying] = useState(true);
|
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(() => {
|
const pauseTrailer = useCallback(() => {
|
||||||
setIsTrailerPlaying(false);
|
setIsTrailerPlaying(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
|
|
@ -1175,6 +1175,8 @@ const TMDBSettingsScreen = () => {
|
||||||
{ code: 'uk', label: 'Українська', native: 'Ukrainian' },
|
{ code: 'uk', label: 'Українська', native: 'Ukrainian' },
|
||||||
{ code: 'vi', label: 'Tiếng Việt', native: 'Vietnamese' },
|
{ code: 'vi', label: 'Tiếng Việt', native: 'Vietnamese' },
|
||||||
{ code: 'th', label: 'ไทย', native: 'Thai' },
|
{ code: 'th', label: 'ไทย', native: 'Thai' },
|
||||||
|
{ code: 'hr',
|
||||||
|
label: 'Hrvatski', native: 'Croatian' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const filteredLanguages = languages.filter(({ label, code, native }) =>
|
const filteredLanguages = languages.filter(({ label, code, native }) =>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue