Пожалуйста, в чем может быть проблема?Я работаю над реагирующим родным 360 VR и иду через образец, который я видел на github, но он не работает.
Invariant Violation: requireNativeComponent: "Video" was not found in the UIManager.
Эта ошибка находится по адресу:
in Video (at GVRVideo.js:13)
in VideoView (at App.js:20)
in RCTView (at View.js:45)
in View (at App.js:19)
in App (at renderApplication.js:34)
in RCTView (at View.js:45)
in View (at AppContainer.js:98)
in RCTView (at View.js:45)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:33)
"
У меня есть GVRVideo.js, GVRPanarama.js и App.js
В моем GVRVideo.js: у меня есть следующий код для GVRVideo в папке компонентов
import React, { Component } from 'react'
import PropTypes from 'prop-types';
import { requireNativeComponent } from 'react-native'
class VideoView extends Component {
render() {
return <RCTViedoView {...this.props} />
}
}
VideoView.propTypes = {
video: PropTypes.shape({
uri: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
}).isRequired,
videoType: PropTypes.string,
volume: PropTypes.number,
displayMode: PropTypes.string,
enableFullscreenButton: PropTypes.bool,
enableCardboardButton: PropTypes.bool,
enableInfoButton: PropTypes.bool,
enableTouchTracking: PropTypes.bool,
hidesTransitionView: PropTypes.bool,
}
// requireNativeComponent automatically resolves this to "VideoManager"
var RCTViedoView = requireNativeComponent('Video', VideoView);
export default VideoView;
В GVRPanarama.js: у меня этот файл также находится в папке компонентов
import React, { Component } from 'react'
import PropTypes from 'prop-types';
import { requireNativeComponent, Image } from 'react-native'
class PanoramaView extends Component {
render() {
return <RCTPanoramaView {...this.props} />
}
}
PanoramaView.propTypes = {
image: Image.propTypes.source,
imageUrl: PropTypes.string,
displayMode: PropTypes.string,
enableFullscreenButton: PropTypes.bool,
enableCardboardButton: PropTypes.bool,
enableInfoButton: PropTypes.bool,
enableTouchTracking: PropTypes.bool,
hidesTransitionView: PropTypes.bool,
}
// requireNativeComponent automatically resolves this to "PanoramaManager"
var RCTPanoramaView = requireNativeComponent('Panorama', PanoramaView);
export default PanoramaView;
App.js:
import React, {Component} from 'react';
import { StyleSheet, View} from 'react-native';
import GVRVideo from './components/GVRVideo';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<GVRVideo />
</View>
);
}
}