我想在我的应用程序中使用react-native-video。但是,我所做的不起作用:
我使用创建了一个新项目expo init Project1
然后我安装了react-native-video:npm install --save react-native-video
我当时用的是这个:react-native link react-native-video
我目前只有 App.js :
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Video from 'react-native-video';
export default function App() {
return (
<View style={styles.container}>
<Video source={{uri: './small.mp4'}} // Can be a URL or a local file.
ref={(ref) => {
this.player = ref
}} // Store reference
o.nBuffer={this.onBuffer} // Callback when remote video is buffering
onError={this.videoError} // Callback when video cannot be loaded …Run Code Online (Sandbox Code Playgroud)