【发布时间】:2021-08-07 18:04:50
【问题描述】:
我试图在 react 本机应用程序上显示视频,但是当我运行应用程序时出现错误 TypeError: undefined is not an object (evalating 'RCTVideoInstance.Constants')
我运行了这些命令,但它不起作用: npm install react-native-video react-native 链接 react-native-video
这是我的代码:
import React from "react";
import {View} from 'react-native';
import CustomBackground from '../Components/CustomBackground';
import Video from 'react-native-video';
import videooo from '../Images/videooo.mp4'
export default class WelcomeScreen extends React.Component{
render(){
return(
<CustomBackground>
<View style={styles.btnWelcome}>
<Video source={videooo} style={styles.images} onBuffer={this.onBuffer} onEnd={this.onEnd} onError={this.videoError}/>
</View>
</CustomBackground>
)
}
}
【问题讨论】:
标签: react-native video react-native-video