react-native-af-video-player
react-native-af-video-player copied to clipboard
TypeError: TypeError: undefined is not an object (evaluating '_reactNative.NativeModules.UIManager.RCTVideo.Constants')
-
[ ] react-native-af-video-player version: 0.2.1
-
[ ] React Native version: 32.0.0
-
[ ] OS: Android
-
[ ] Has this issue already been raised? No
-
[ ] Have you clearly read and understood the Readme? Yes
-
[ ] Code and explanation to replicate this issue: import React, {Component} from "react"; import { AppRegistry, StyleSheet, Text, Image, View, TouchableOpacity, FlatList, AsyncStorage, TouchableHighlight, Modal, Alert, Button, WebView, Dimensions, KeyboardAvoidingView, ScrollView } from "react-native"; import Video from 'react-native-af-video-player' const styles = StyleSheet.create({ container: { flex:1, justifyContent: 'flex-start' }, });
export default class SingleFeedsScreen extends React.PureComponent {
constructor(props) {
console.log("SelectInterestScreen");
super(props);
}
render() {
let videoURI ='http://qa.localcircles.com/a/userattachments/2193/The_Gandhi_Murder_Hindi_Official_Trailer_-_Independent_Indias_First_Political_Assassination4___20190612092221___.mp4';
return (
<View style={styles.container}>
<Video style={{width:100, height:100}} url={videoURI} logo={'http://qa.localcircles.com/a/userattachments/2193/Screenshot_6___20190612024730___.png'}/>
</View>
);
}
}
- [ ] Are there any console logs?
TypeError: TypeError: undefined is not an object (evaluating '_reactNative.NativeModules.UIManager.RCTVideo.Constants')
This error is located at: in Video (at Video.js:383) in RCTView (at View.js:44) in AnimatedComponent (at Video.js:369) in Video (at SingleFeedsScreen.js:82) in RCTView (at View.js:44) in SingleFeedsScreen (created by SceneView) in SceneView (created by SwitchView) in SwitchView (created by Navigator) in Navigator (at createAppContainer.js:388) in NavigationContainer (at App.js:20) in App (at withExpoRoot.js:22) in RootErrorBoundary (at withExpoRoot.js:21) in ExpoRootComponent (at renderApplication.js:34) in RCTView (at View.js:44) in RCTView (at View.js:44) in AppContainer (at renderApplication.js:33)
This error is located at: in NavigationContainer (at App.js:20) in App (at withExpoRoot.js:22) in RootErrorBoundary (at withExpoRoot.js:21) in ExpoRootComponent (at renderApplication.js:34) in RCTView (at View.js:44) in RCTView (at View.js:44) in AppContainer (at renderApplication.js:33)
- node_modules\react-native-video\Video.js:187:58 in render
- node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:10563:21 in finishClassComponent
- ... 18 more stack frames from framework internals
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.%s, in Icon (at ToggleIcon.js:37) in RCTView (at View.js:44) in AnimatedComponent (at TouchableOpacity.js:256) in TouchableOpacity (at ToggleIcon.js:34) in RCTView (at View.js:44) in ToggleIcon (at ControlBar.js:38) in RCTView (at View.js:44) in LinearGradient (at ControlBar.js:30) in ControlBar (at Controls.js:153) in RCTView (at View.js:44) in AnimatedComponent (at Controls.js:137) in TouchableWithoutFeedback (at Controls.js:136) in Controls (at Video.js:404) in RCTView (at View.js:44) in AnimatedComponent (at Video.js:369) in Video (at SingleFeedsScreen.js:82) in RCTView (at View.js:44) in SingleFeedsScreen (created by SceneView) in SceneView (created by SwitchView) in SwitchView (created by Navigator) in Navigator (at createAppContainer.js:388) in NavigationContainer (at App.js:20) in App (at withExpoRoot.js:22)
-
node_modules\react-native\Libraries\YellowBox\YellowBox.js:59:8 in error
-
node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:619:8 in warningWithoutStack
-
... 20 more stack frames from framework internals
-
[ ] Include Screeshots / Video:
Hi,do you resolved it?😀
I've recently facing this same issue with RN 0.60.0. Installing package by running npm i -S react-native-af-video-player
and that's all. I didn't do any linking since the new environment of RN doesn't require link command.
From error log it shows the location node_modules\react-native-af-video-player\node_modules\react-native-video\Video.js
on the line 187 which is nativeResizeMode = NativeModules.UIManager.RCTVideo.Constants.ScaleAspectFit;
You people can stop using this module as this issue will keep coming, there is another better and trustable API 'Video' by expo that you can use and it works exceptionally well. Sample code is given below -
`import {Video} from 'expo';
<Video source={{ uri: url }} rate={1.0} volume={1.0} isMuted={false} resizeMode="contain" useNativeControls style={{ width: this.containerWidth}} onError = {(e)=>{console.log(e)}} /> `
There is a prop 'useNativeControls' which will use native control buttons provided by the platform and fulfil all your basic needs of the video player.
For more detailed information, you can follow - [https://docs.expo.io/versions/v34.0.0/sdk/video]