Closed domene96 closed 4 years ago
`import React, {Component} from 'react'; import {Text, View, Button, Image, StyleSheet, Platform, NetInfo, Alert} from 'react-native'; import Video from 'react-native-video'; import allStyles from '../css/allStylesCSS.js'; import Menu from './Menu'; import Rabbit from '../rabbit.mp4'; // import MediaControls, { PLAYER_STATES } from 'react-native-media-controls';
export default class VideoComponent extends React.Component { render () { return ( <View style={{position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, justifyContent: 'center', alignItems: 'center', zIndex: 9,}}> <Video source={ Rabbit } ref={(ref) => { this.player = ref }} // Store reference onBuffer={this.onBuffer} // Callback when remote video is buffering onError={this.videoError} // Callback when video cannot be loaded style={styles.backgroundVideo} resizeMode={"cover"} /> ) } }
const styles = StyleSheet.create({ backgroundVideo: { position: 'absolute', top: 0, left: 0, bottom: 0, right: 0 } });`
You have a problem linking the library
I have linked it
ios or android? lib version?
package.json
{ "main": "node_modules/expo/AppEntry.js", "name": "Chinatown", "version": "0.1.01", "private": true, "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject" }, "dependencies": { "expo": "^34.0.4", "firebase": "^6.5.0", "react": "16.9.0", "react-dom": "^16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz", "react-native-communications": "^2.2.1", "react-native-datepicker": "^1.7.2", "react-native-easy-grid": "^0.2.2", "react-native-fast-image": "^7.0.2", "react-native-fcm": "^16.2.4", "react-native-gesture-handler": "^1.3.0", "react-native-image-zoom-viewer": "^2.2.26", "react-native-lightbox": "^0.8.0", "react-native-live-stream": "^1.0.1", "react-native-media-controls": "^1.1.1", "react-native-reanimated": "^1.1.0", "react-native-video": "^5.0.0", "react-native-web": "^0.11.7", "react-navigation": "^4.0.0", "react-navigation-stack": "^1.5.1", "uuid": "^3.3.3" }, "devDependencies": { "babel-preset-expo": "^6.0.0" } }
I'm having this particular issue on android but on ios I'm having a very similar error: null is not an object (evaluating 'RNFIRMessaging.setNotifications...')
This can happen if the device/simulator has an old build. Try uninstalling the app from device/simulator and install using xcode. That should resolve the issue
RNFIRMessaging.setNotifications is not from this lib, is from Firebase AFAIK
Having the same issue, cant able to resolve. please help.
After doing react-native link react-native-video
instead of import Video from 'react-native-video';
do it, like this
import Video from 'react-native';
Then, either you got it fixed or jump into next level of 'Games of Bugs' of RN!
still not working
I stumbled across a solution after struggling with this - none of the suggestions I had run into were working, including running react-native link, restarting the simulator or using the expo video component. Finally I came across:
https://docs.expo.io/versions/v36.0.0/sdk/video/
If all suggested methods are failing for react-native-video, I suggest working with expo-av.
run npm install --save expo-av
import { Video } from 'expo-av';
export default class YourClass extends Component {
render() {
return (
<View>
<Video
source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }}
rate={1.0}
volume={1.0}
isMuted={false}
resizeMode="cover"
shouldPlay
isLooping
style={{ width: 300, height: 300 }}
/>
</View>
);
}
}
hi,Have you solved this problem?
@domene96 I am having the same issue, were you able to solve this problem?
@domene96 same issue. Were you able to solve it?
I stumbled across a solution after struggling with this - none of the suggestions I had run into were working, including running react-native link, restarting the simulator or using the expo video component. Finally I came across:
https://docs.expo.io/versions/v36.0.0/sdk/video/
If all suggested methods are failing for react-native-video, I suggest working with expo-av.
run npm install --save expo-av
import { Video } from 'expo-av'; export default class YourClass extends Component { render() { return ( <View> <Video source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} rate={1.0} volume={1.0} isMuted={false} resizeMode="cover" shouldPlay isLooping style={{ width: 300, height: 300 }} /> </View> ); } }
is this going to work well with vanila react native project ?
I'm not using expo, I'm getting the same error is there any solution?, its work IOS but android doesn't work.
I am using Expo still getting this error? but this looks closed is it resolved?
Why this issue is closed? Still getting the error.
so after 2 hours of debugging doing some random things..... I found a solution. This project uses some kind of old Git and gradle can't get it without jcenter().
Anyways, add jcenter() in allProjects to your build.gradle (not APP build.gradle) and npx react-native run-android (rebuild)
same issue
This actually worked for me and change the error to: [Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
so after 2 hours of debugging doing some random things..... I found a solution. This project uses some kind of old Git and gradle can't get it without jcenter().
Anyways, add jcenter() in allProjects to your build.gradle (not APP build.gradle) and npx react-native run-android (rebuild)
work for me
still not working do you get the solution??
so after 2 hours of debugging doing some random things..... I found a solution. This project uses some kind of old Git and gradle can't get it without jcenter(). Anyways, add jcenter() in allProjects to your build.gradle (not APP build.gradle) and npx react-native run-android (rebuild)
work for me
It worked
Yes
On Fri, 8 Apr 2022, 17:45 YASH6004, @.***> wrote:
so after 2 hours of debugging doing some random things..... I found a solution. This project uses some kind of old Git and gradle can't get it without jcenter(). Anyways, add jcenter() in allProjects to your build.gradle (not APP build.gradle) and npx react-native run-android (rebuild) [image: image] https://user-images.githubusercontent.com/45225030/143676752-f50b4cd1-a436-44ed-8bc6-852fd0dd401d.png
work for me
It worked
— Reply to this email directly, view it on GitHub https://github.com/react-native-video/react-native-video/issues/1738#issuecomment-1092798167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV6OTOM5MHQ4CDZSW2WYBTTVEAPN5ANCNFSM4ITG4F2Q . You are receiving this because you commented.Message ID: @.***>
Still getting the same error. I have tried everything. Uninstalling from Xcode and then re-install not working for me. The pod installs not working. Linked manually not working.
I stumbled across a solution after struggling with this - none of the suggestions I had run into were working, including running react-native link, restarting the simulator or using the expo video component. Finally I came across:
https://docs.expo.io/versions/v36.0.0/sdk/video/
If all suggested methods are failing for react-native-video, I suggest working with expo-av.
run npm install --save expo-av
import { Video } from 'expo-av'; export default class YourClass extends Component { render() { return ( <View> <Video source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} rate={1.0} volume={1.0} isMuted={false} resizeMode="cover" shouldPlay isLooping style={{ width: 300, height: 300 }} /> </View> ); } }
LifeSaver!!!! This solution works very well when no other solution worked. 1 million thanks!
Warning: Can't perform a React state update 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 %s.%s, the componentWillUnmount method, in Cpi (at SceneView.js:9) in SceneView (at StackViewLayout.tsx:910) in RCTView (at View.js:45) in View (at createAnimatedComponent.js:151) in AnimatedComponent (at StackViewCard.tsx:106) in RCTView (at View.js:45) in View (at createAnimatedComponent.js:151) in AnimatedComponent (at screens.native.js:71) in Screen (at StackViewCard.tsx:93) in Card (at createPointerEventsContainer.tsx:95) in Container (at StackViewLayout.tsx:982) in RCTView (at View.js:45) in View (at screens.native.js:101) in ScreenContainer (at StackViewLayout.tsx:394) in RCTView (at View.js:45) in View (at createAnimatedComponent.js:151) in AnimatedComponent (at StackViewLayout.tsx:384) in PanGestureHandler (at StackViewLayout.tsx:377) in StackViewLayout (at withOrientation.js:30) in withOrientation (at StackView.tsx:103) in RCTView (at View.js:45) in View (at Transitioner.tsx:267) in Transitioner (at StackView.tsx:40) in StackView (at createNavigator.js:81) in Navigator (at createKeyboardAwareNavigator.js:12) in KeyboardAwareNavigator (at createAppContainer.js:430)
TypeError: TypeError: null is not an object (evaluating 'RCTVideoInstance.Constants')
This happens for many different implementations of