react-native-video-player
Version:
A <VideoPlayer /> component for React Native with controls
66 lines (65 loc) • 1.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Thumbnail = exports.StartButton = void 0;
var _reactNative = require("react-native");
var _react = require("react");
var _jsxRuntime = require("react/jsx-runtime");
const StartButton = ({
onStart,
customStylesPlayButton,
customStylesPlayArrow
}) => {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
style: [styles.playButton, customStylesPlayButton],
onPress: onStart,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
source: require('./img/play.png'),
style: [styles.playArrow, customStylesPlayArrow]
})
});
};
exports.StartButton = StartButton;
const Thumbnail = exports.Thumbnail = /*#__PURE__*/(0, _react.memo)(({
thumbnailSource,
style,
sizeStyles,
onStart,
customStylesThumbnail,
customStylesThumbnailImage,
customStylesPlayButton,
customStylesPlayArrow
}) => {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
source: thumbnailSource,
imageStyle: customStylesThumbnailImage,
style: [styles.thumbnail, sizeStyles, style, customStylesThumbnail],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StartButton, {
customStylesPlayButton: customStylesPlayButton,
onStart: onStart,
customStylesPlayArrow: customStylesPlayArrow
})
});
});
const styles = _reactNative.StyleSheet.create({
thumbnail: {
backgroundColor: 'black',
justifyContent: 'center',
alignItems: 'center'
},
playButton: {
backgroundColor: 'rgba(0, 0, 0, 0.6)',
borderRadius: 32,
width: 64,
height: 64,
justifyContent: 'center',
alignItems: 'center'
},
playArrow: {
width: 28,
height: 28,
marginLeft: 2
}
});
//# sourceMappingURL=Thumbnail.js.map