import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {IFound} from './index';
import VideoControls from 'react-native-video-custom-controls';
interface IProps {
data: IFound;
}
class Item extends React.Component<IProps> {
render() {
const {data} = this.props;
return (
<View>
<Text>{data.title}</Text>
<VideoControls
source={{uri: data.videoUrl}}
paused={true}
style={styles.video}
/>
</View>
);
}
}
const styles = StyleSheet.create({
video: {
height: 220,
},
});
export default Item;
版本如下;
{
"name": "buluteacherapp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/slider": "^3.0.3",
"@react-navigation/bottom-tabs": "^5.11.8",
"@react-navigation/material-top-tabs": "^5.3.14",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"@types/lodash": "^4.14.168",
"@types/react-native-snap-carousel": "^3.8.2",
"@types/react-native-video": "^5.0.4",
"axios": "^0.21.1",
"babel-plugin-module-resolver": "^4.1.0",
"dva-core-ts": "^2.0.7",
"dva-loading-ts": "^3.0.23",
"dva-model-extend": "^0.1.2",
"lodash": "^4.17.21",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-circular-progress": "^1.3.7",
"react-native-config": "^1.4.2",
"react-native-drag-sort": "^2.4.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-linear-animated-gradient-transition": "^0.1.6",
"react-native-linear-gradient": "^2.5.6",
"react-native-pager-view": "^5.0.12",
"react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^2.18.1",
"react-native-slider-x": "^0.11.3",
"react-native-snap-carousel": "^3.9.1",
"react-native-sound": "^0.11.0",
"react-native-storage": "^1.0.1",
"react-native-svg": "^12.1.0",
"react-native-tab-view": "^3.0.0",
"react-native-video": "^5.1.1",
"react-native-video-custom-controls": "^0.1.0",
"react-navigation-header-buttons": "^7.0.0",
"react-redux": "^7.2.2",
"realm": "^10.2.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^1.1.0",
"@types/jest": "^25.2.3",
"@types/react-native": "^0.63.2",
"@types/react-redux": "^7.1.16",
"@types/react-test-renderer": "^16.9.2",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-native-iconfont-cli": "^2.2.1",
"react-test-renderer": "16.13.1",
"typescript": "^3.8.3"
},
"resolutions": {
"@types/react": "^16"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
}
从入门到实战,掌握用TypeScript开发ReactNative应用
了解课程