question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Player is accessed on the wrong thread

See original GitHub issue

🐛 Bug Report

When the video is playing and seek to some position (using SeekTo), it shows in output window this error:

10-25 16:29:22.618 W/SimpleExoPlayer( 4743): Player is accessed on the wrong thread. See https://google.github.io/ExoPlayer/faqs.html#what-do-player-is-accessed-on-the-wrong-thread-warnings-mean
10-25 16:29:22.618 W/SimpleExoPlayer( 4743): java.lang.IllegalStateException
10-25 16:29:22.618 W/SimpleExoPlayer( 4743): 	at com.google.android.exoplayer2.SimpleExoPlayer.verifyApplicationThread(SimpleExoPlayer.java:1192)
10-25 16:29:22.618 W/SimpleExoPlayer( 4743): 	at com.google.android.exoplayer2.SimpleExoPlayer.getPlaybackParameters(SimpleExoPlayer.java:946)

Note that the video still working and seek to the position, but show this error.

Expected behavior

The video seek to the position and don’t show any error message.

Reproduction steps

Play some video and when it update the progress in PositionChanged, call MediaManager.SeekTo(position).

Configuration

Version: 0.8.18

Platform:

  • 📱 iOS
  • [x ] 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sunsizcommented, May 28, 2022

This issue still happening in the Plugin.MediaManager.Forms 1.1.1 version When app play the local audio file from an activity on create event in the Android 7 or earlier it only play 2 second then crash, in the debug window display blow information (those from android 6 emulator, on android 7 a lot of repeated “Player is accessed on the wrong thread” message): `[EGL_emulation] eglMakeCurrent: 0xae654660: ver 3 1 (tinfo 0xae652b60)

[SimpleExoPlayer] Player is accessed on the wrong thread. See https://exoplayer.dev/issues/player-accessed-on-wrong-thread

[SimpleExoPlayer] java.lang.IllegalStateException

[SimpleExoPlayer] at com.google.android.exoplayer2.SimpleExoPlayer.verifyApplicationThread(SimpleExoPlayer.java:1575)

[SimpleExoPlayer] at com.google.android.exoplayer2.SimpleExoPlayer.stop(SimpleExoPlayer.java:1281)

[SimpleExoPlayer] Player is accessed on the wrong thread. See https://exoplayer.dev/issues/player-accessed-on-wrong-thread

[EGL_emulation] eglMakeCurrent: 0xae654660: ver 3 1 (tinfo 0xae652b60)

[Surface] getSlotFromBufferLocked: unknown buffer: 0x99efbba0` But the same file play with a button to test sound, it plays without problem.

0reactions
g4mb10rcommented, Sep 2, 2020

I also have this bug. I can’t play audio.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exoplayer throws Player is accessed on the wrong thread ...
In onResume() from MainActivity I set exoPlayer.experimentalSetOffloadSchedulingEnabled(false); which throws "Player is accessed on the wrong ...
Read more >
Player is accessed on the wrong thread. · Issue #10333
You need to make sure that the player is not accessed from another thread. If this happens you need to create a Handler...
Read more >
Troubleshooting
What do “Player is accessed on the wrong thread” errors mean? See A note on threading on the getting started page. How can...
Read more >
com.google.android.exoplayer2.SimpleExoPlayer. ...
private void verifyApplicationThread() { · if (Looper.myLooper() != · "Player is accessed on the wrong thread. See " · "https://google.github.io/ExoPlayer/faqs.
Read more >
Player is accessed on the wrong thread
Player is accessed on the wrong thread ; Clear reproduction steps including observed and expected behavior. Play video and press powerbutton ( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found