Why RCTNodePlayer was not found?

Use react-native-nodemediaclient, but got an error and went into the module itself. There
import React { Component } from 'react';
import { PropTypes } from 'prop-types';
import { requireNativeComponent, View, UIManager, findNodeHandle } from 'react-native';



var RCT_VIDEO_REF = 'NodePlayerView';

NodePlayerView class extends Component {
 constructor(props) {
super(props);
}
 _onChange(event) {
 if (!this.props.onStatus) {
return;
}
 this.props.onStatus(event.nativeEvent.code, event.nativeEvent.message);
}

 pause() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs[RCT_VIDEO_REF]),
UIManager.RCTNodePlayer.Commands.pause
null
);
}

 start() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs[RCT_VIDEO_REF]),
UIManager.RCTNodePlayer.Commands.start
null
);
}

 stop() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs[RCT_VIDEO_REF]),
UIManager.RCTNodePlayer.Commands.stop
null
);
}

 render() {
 return <RCTNodePlayer
{...this.props}
ref={RCT_VIDEO_REF}
onChange={this._onChange.bind(this)}
/>;
};
}
NodePlayerView.name = RCT_VIDEO_REF;
NodePlayerView.propTypes = {
 inputUrl: PropTypes.string,
 bufferTime: PropTypes.number,
 maxBufferTime: PropTypes.number,
 autoplay: PropTypes.bool
 scaleMode: PropTypes.oneOf(['ScaleToFill', 'ScaleAspectFit', 'ScaleAspectFill']),
 renderType: PropTypes.oneOf(['SURFACEVIEW', 'TEXTUREVIEW']),
 onStatus: PropTypes.func
 ...View.propTypes // 包含默认的View的属性
};

const RCTNodePlayer = requireNativeComponent('RCTNodePlayer', NodePlayerView, {
 nativeOnly: { onChange: true }
});

module.exports = NodePlayerView;


Error in the emulator - RCTNodePlayer was not found in the UIManager

how can I fix it? Thanks in advance
March 20th 20 at 11:31
1 answer
March 20th 20 at 11:33
Specifically, this library was not used, I think I saw similar errors when not linked to the native part of the library.
Re-read carefully the installation instructions of this library:
- check out react-native link
- check the gradle file, if you are collecting for android
- check pod-s, if you are building for ios
- rebuild the build completely

Find more questions by tags JavaScriptAndroidReact Native