import * as React from "react"; import { useRef, useState, useReducer, useEffect } from "react"; import { View, Animated, Easing } from "react-native"; import Video, { VideoProperties, OnProgressData, OnLoadData, } from "react-native-video"; import { VideoPlayerNativeContainer } from "./styed"; import { videoPlayerReducer } from "./video-player-reducer"; import Overlay from "./components/overlay"; import Controls from "./components/controls"; import { Gateway } from "react-gateway"; type VideoPlayerProps = {} & VideoProperties; const absoluteStyle = { width: "100%", height: "100%", top: 0, bottom: 0, position: "absolute", }; function VideoPlayerNative(props: VideoPlayerProps) { const [ { isPaused, progress, duration, progressLayout, fullScreenMode }, dispatch, ] = useReducer(videoPlayerReducer, { isPaused: false, duration: 0, progressLayout: {}, }); const videoProgressRef = useRef(); const showControlsRef = useRef(undefined); const [controlsShow, setControlsShow] = useState(false); const opacityAnimation = useRef(new Animated.Value(0)).current; const videoPlayerRef = useRef