@zezosoft/zezo-ott-react-native-video-player
Version:
Production-ready React Native OTT video player library for Android & iOS. Features: playlists, seasons, auto-next playback, subtitles (SRT/VTT), custom theming, analytics tracking, fullscreen mode, gesture controls, ads player (pre-roll/mid-roll/post-roll
57 lines (56 loc) • 1.4 kB
JavaScript
"use strict";
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import Animated from 'react-native-reanimated';
import { scale } from 'react-native-size-matters';
import { useVideoPlayerConfig } from "../context/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
const Toast = ({
message,
animatedStyle,
insets,
position = 'top'
}) => {
const {
colors
} = useVideoPlayerConfig();
const containerStyle = [styles.container, position === 'top' ? {
top: (insets.top || 0) + scale(6)
} : {
bottom: (insets.bottom || 0) + scale(6)
}, animatedStyle];
return /*#__PURE__*/_jsx(Animated.View, {
style: containerStyle,
children: /*#__PURE__*/_jsx(View, {
style: styles.toast,
children: /*#__PURE__*/_jsx(Text, {
style: [styles.text, {
color: colors.text
}],
children: message
})
})
});
};
const styles = StyleSheet.create({
container: {
position: 'absolute',
alignSelf: 'center',
zIndex: 1000
},
toast: {
paddingHorizontal: scale(12),
paddingVertical: scale(6),
borderRadius: scale(4),
minWidth: scale(80),
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.75)'
},
text: {
fontSize: scale(12),
fontWeight: '600'
}
});
export default Toast;
//# sourceMappingURL=Toast.js.map