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

player-accessed-on-wrong-thread #2966

Closed
sandeep14 opened this issue Dec 21, 2022 · 8 comments
Closed

player-accessed-on-wrong-thread #2966

sandeep14 opened this issue Dec 21, 2022 · 8 comments

Comments

@sandeep14
Copy link

Bug

below is error reported on playstore console
Exception java.lang.IllegalStateException: Player is accessed on the wrong thread. See https://exoplayer.dev/issues/player-accessed-on-wrong-thread
at com.google.android.exoplayer2.SimpleExoPlayer.verifyApplicationThread (SimpleExoPlayer.java)
at com.google.android.exoplayer2.SimpleExoPlayer.getPlayWhenReady (SimpleExoPlayer.java)
at com.brentvatne.exoplayer.ReactExoplayerView.pausePlayback (ReactExoplayerView.java)
at com.brentvatne.exoplayer.ReactExoplayerView.onAudioFocusChange (ReactExoplayerView.java)
at android.media.AudioManager$ServiceEventHandlerDelegate$1.handleMessage (AudioManager.java:3017)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:246)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java)
at java.lang.Thread.run (Thread.java:923)

Platform

android

Which player are you experiencing the problem on:

  • Android

Environment info

react-version 0.70.6

Library version: 5.2.1

@freeboub
Copy link
Collaborator

can it be reproduced on master branch ?

@freeboub freeboub added Platform: Android triage needed Help needed to confirm the issue labels Dec 21, 2022
@freeboub freeboub added the stale Closed due to inactivity or lack or resources label Jan 3, 2023
@freeboub freeboub closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@kyle-ssg
Copy link

kyle-ssg commented Oct 3, 2023

I can confirm this is replicable 6.0.0-alpha.6 at least, though in rare circumstances. I have only 1 Sentry report of this

Redmi Note 10 Pro
Android 11

@freeboub
Copy link
Collaborator

freeboub commented Oct 3, 2023

@kyle-ssg can you provide the callstack please?

@freeboub freeboub removed the stale Closed due to inactivity or lack or resources label Oct 3, 2023
@freeboub freeboub reopened this Oct 3, 2023
@kyle-ssg
Copy link

kyle-ssg commented Oct 3, 2023

image

Hope this helps, thanks so much for all the effort into this library.

@freeboub freeboub self-assigned this Oct 12, 2023
@freeboub freeboub added bug and removed triage needed Help needed to confirm the issue labels Oct 14, 2023
@freeboub
Copy link
Collaborator

This issue will be fixed in 6.0.0-alpha.9

Let me know if you have other crash reposted by crashlytics, it is always interesting !

@PadovaY
Copy link

PadovaY commented Jun 18, 2024

hey, this crash happens to me in release mode, mostly on android 13/14 devices. version: 6.2.0.
any suggestion?

stacktrace:

Fatal Exception: java.lang.IllegalStateException: Player is accessed on the wrong thread.
Current thread: 'mqt_native_modules'
Expected thread: 'main'
See https://developer.android.com/guide/topics/media/issues/player-accessed-on-wrong-thread
       at androidx.media3.exoplayer.ExoPlayerImpl.verifyApplicationThread(ExoPlayerImpl.java:2798)
       at androidx.media3.exoplayer.ExoPlayerImpl.getPlayWhenReady(ExoPlayerImpl.java:817)
       at com.brentvatne.exoplayer.ReactExoplayerView.pausePlayback(ReactExoplayerView.java:1257)
       at com.brentvatne.exoplayer.ReactExoplayerView.-$$Nest$mpausePlayback()
       at com.brentvatne.exoplayer.ReactExoplayerView$OnAudioFocusChangedListener.onAudioFocusChange(ReactExoplayerView.java:1180)
       at android.media.AudioManager$ServiceEventHandlerDelegate$1.handleMessage(AudioManager.java:4318)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:233)
       at java.lang.Thread.run(Thread.java:1012)

@freeboub
Copy link
Collaborator

@PadovaY here is a fix for the issue: #3916

@forchello
Copy link

@PadovaY here is a fix for the issue: #3916

The latest version has stopped crashing, but I have a black screen flashing in android. And yes, I changed the shutterColor to transparent, but nothing happened.

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

No branches or pull requests

5 participants