Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube player crashes when user clicks on notification when video is playing #432

Open
cw-shubham-rajput opened this issue Feb 12, 2020 · 9 comments

Comments

@cw-shubham-rajput
Copy link

crash logs
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
at com.google.android.youtube.player.YouTubeStandalonePlayer.getReturnedInitializationResult(Unknown Source:0)
at com.inprogress.reactnativeyoutube.YouTubeStandaloneModule$1.onActivityResult(YouTubeStandaloneModule.java:44)
at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:277)

Adding null check would help

@diennt90
Copy link

I need play video youtube in my react native app and my app has crash same this problem
My video

Share My code:
<YouTube ref={this._youTubeRef} apiKey="ApiKEY" videoId={zQadr3b_kmo} play={this.state.isPlaying} loop={this.state.isLooping} fullscreen={this.state.fullscreen} controls={1} style={styles.player} onError={e => { this.setState({ error: e.error }); }} onReady={e => { this.setState({ isReady: true }); }} onChangeState={e => { this.setState({ status: e.state }); }} onChangeQuality={e => { this.setState({ quality: e.quality }); }} onChangeFullscreen={e => { this.setState({ fullscreen: e.isFullscreen }); }} onProgress={e => { this.setState({ currentTime: e.currentTime }); }} />
Please help me, thanks guys

@davidohayon669
Copy link
Owner

@cw-shubham-rajput what notifications?

@cw-shubham-rajput
Copy link
Author

@davidohayon669 push notifications.

@jespejoh
Copy link

jespejoh commented May 6, 2020

I'm experiencing the same issue but when putting the app in the background while the video plays full screen – and it's pretty easy to solve (done in this PR actually --> #368). It looks like the library cannot handle the switch from background to foreground. For now I'm solving it by patching the library locally (without any other known unintended consequences so far). It would be great if the fix is merged into the main repo :) Thanks for your work on this!

@deepak-jha-kgp
Copy link

I too have been using it for a while now with the patch in production for almost a month now. No side effects so far, looking forward to getting it merged.

@zchwyng
Copy link

zchwyng commented Aug 12, 2020

+1

1 similar comment
@felansu
Copy link

felansu commented Oct 22, 2020

+1

@akashshukla232582
Copy link

We are also facing same issues , please provide me solution on this

@zabojad
Copy link
Collaborator

zabojad commented Mar 9, 2023

Still happening on latest version:

java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
    at com.google.android.youtube.player.YouTubeStandalonePlayer.getReturnedInitializationResult
    at com.inprogress.reactnativeyoutube.YouTubeStandaloneModule$1.onActivityResult(YouTubeStandaloneModule.java:44)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants