Использую react-native-nodemediaclient, но получил ошибку и зашел в сам модуль. Там такое
import React, { Component } from 'react';
import { PropTypes } from 'prop-types';
import { requireNativeComponent, View, UIManager, findNodeHandle } from 'react-native';
var RCT_VIDEO_REF = 'NodePlayerView';
class NodePlayerView 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;
Ошибка в эмуляторе -
RCTNodePlayer was not found in the UIManager
как можно исправить ее? Заранее спасибо