import React, {createRef} from 'react'; import {Image, Platform, TouchableHighlight} from 'react-native'; import {Control} from '../Control'; import {NullControl} from '../NullControl'; import type {VideoAnimations} from '../../types'; import {styles} from './styles'; export const playPauseRef = createRef(); interface PlayPauseProps { animations: VideoAnimations; disablePlayPause: boolean; disableSeekButtons: boolean; paused: boolean; togglePlayPause: () => void; resetControlTimeout: () => void; showControls: boolean; onPressForward: () => void; onPressRewind: () => void; } const play = require('../../assets/img/play.png'); const pause = require('../../assets/img/pause.png'); const rewind = require('../../assets/img/rewind.png'); const forward = require('../../assets/img/forward.png'); export const PlayPause = ({ animations: {AnimatedView, ...animations}, disablePlayPause, disableSeekButtons, paused, togglePlayPause, resetControlTimeout, showControls, onPressForward, onPressRewind, }: PlayPauseProps) => { let source = paused ? play : pause; const animatedStyles = { zIndex: showControls ? 99999 : 0, }; if (disablePlayPause) { return ; } return ( {!disableSeekButtons ? ( ) : null} {!disableSeekButtons ? ( ) : null} ); };