mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
Revert TrailerContext.tsx to before d6c3e81e
This commit is contained in:
parent
fc56980399
commit
c43e6d879f
1 changed files with 0 additions and 13 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import * as ScreenOrientation from 'expo-screen-orientation';
|
||||
|
||||
import React, { createContext, useContext, useState, useCallback, useMemo, ReactNode } from 'react';
|
||||
|
||||
interface TrailerContextValue {
|
||||
|
|
@ -14,17 +12,6 @@ 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);
|
||||
}, []);
|
||||
|
|
|
|||
Loading…
Reference in a new issue