import React, { useState } from 'react'; import { View, StyleSheet, Text, Dimensions, TouchableWithoutFeedback, Platform } from 'react-native'; import { Icon, Slider } from 'react-native-elements'; import C from 'rn-class'; const { width } = Dimensions.get('window'); export const PLACEHOLDER_WIDTH = width / 4; export default PlayerControls = props => { const { Pages, closePlayer, currentPlayerValue, setCurrentPlayerValue} = props; const [curPlayerValue, setCurPlayerValue] = useState(0); const [isPlay, setPlay] = useState(false); const onSetPlay = () => { setPlay(!isPlay); } const getThumbTopFromStyleHeight = (styleHeight=40, trackHeight=4) => { const thumbTop = (styleHeight / 2) + (trackHeight / 2) + (Platform.OS==='android'&&(styleHeight<40||trackHeight<4)?0.5:0); return { sh: {height:styleHeight}, th: {height:trackHeight}, tt: {top:thumbTop} } } const sliderLayout = getThumbTopFromStyleHeight(20,2); return ( <> {Pages.subtitle.replace(/\r\n|\n|\r/gm,' ')} {`2:50`} setCurrentPlayerValue(value)} /> { isPlay ? : } ); }; const styles = StyleSheet.create({ container: { ...StyleSheet.absoluteFillObject, flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center' }, placeholder: { width: PLACEHOLDER_WIDTH } });