Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
769 stars 306 forks source link

[Android] Player is accessed on the wrong thread #634

Open rrispoli opened 5 years ago

rrispoli commented 5 years ago

🐛 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:

martijn00 commented 4 years ago

Is this still a bug?

reshnas commented 4 years ago

the same bug on when playing audio also

ravikiran18 commented 4 years ago

Is this bug fixed in the latest version? Because still, I face this issue in the latest version.

shaks786 commented 4 years ago

Any workaround for this?

abjelosevic commented 4 years ago

the same bug on when playing audio

g4mb10r commented 4 years ago

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

sunsiz commented 2 years ago

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.