import React from 'react'; import { View, StyleSheet, Dimensions, Text, Platform } from 'react-native'; import { NativeVideoPlayer } from './NativeVideoPlayer'; const { width } = Dimensions.get('window'); const VIDEO_HEIGHT = width * 0.5625; interface Props { uri: string | null; } export function VideoPlayer({ uri }: Props) { if (!uri) { return ( 视频加载中... ); } if (Platform.OS === 'web') { return ( ); } return ; } const styles = StyleSheet.create({ container: { width, height: VIDEO_HEIGHT, backgroundColor: '#000' }, placeholder: { justifyContent: 'center', alignItems: 'center' }, placeholderText: { color: '#fff', fontSize: 14 }, });