@8man/react-native-media-console
Version:
Controls for react-native-video
87 lines • 2.47 kB
JavaScript
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from 'react';
import { View } from 'react-native';
import { styles } from './styles';
import { formatTime } from '@8man/react-native-media-console/src/utils';
import { Text } from 'react-native';
export const Seekbar = ({
seekColor,
seekerFillWidth,
seekerPosition,
cachedPosition,
seekerPanHandlers,
setSeekerWidth,
showDuration,
showHours,
showTimeRemaining,
time,
duration
}) => {
return /*#__PURE__*/React.createElement(View, {
style: {
marginBottom: 55,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'flex-end'
}
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
style: {
color: 'hsl(0, 0%, 70%)'
}
}, formatTime({
duration,
time,
showDuration,
showHours,
showTimeRemaining
}))), /*#__PURE__*/React.createElement(View, _extends({
style: {
...styles.container,
width: '80%'
},
collapsable: false
}, seekerPanHandlers), /*#__PURE__*/React.createElement(View, {
style: styles.track,
onLayout: event => setSeekerWidth(event.nativeEvent.layout.width),
pointerEvents: 'none'
}, /*#__PURE__*/React.createElement(View, {
style: [{
width: cachedPosition,
backgroundColor: '#dedede',
height: 4,
position: 'absolute',
top: 0,
borderRadius: 3
}],
pointerEvents: 'none'
}), /*#__PURE__*/React.createElement(View, {
style: [styles.fill, {
width: seekerFillWidth,
backgroundColor: seekColor || '#FFF'
}],
pointerEvents: 'none'
})), /*#__PURE__*/React.createElement(View, {
style: [styles.handle, {
left: seekerPosition
}],
pointerEvents: 'none'
}, /*#__PURE__*/React.createElement(View, {
style: [styles.circle, {
backgroundColor: seekColor || '#FFF'
}],
pointerEvents: 'none'
}))), /*#__PURE__*/React.createElement(View, {
style: {}
}, /*#__PURE__*/React.createElement(Text, {
style: {
color: 'hsl(0, 0%, 70%)'
}
}, formatTime({
duration,
time: duration,
showDuration,
showHours,
showTimeRemaining
}))));
};
//# sourceMappingURL=Seekbar.js.map