Baseflow / XamarinMediaManager

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

Stream plays on Android 12 only when using a breakpoint and exploding the "CrossMediaManager.Current" properties to check if a player or mediasession exists. #862

Closed lobons closed 1 year ago

lobons commented 2 years ago

Hi @martijn00 after updating to version 1.1.1 I'm able to play the video on Android 12 only with a "trick" on debug mode (can't find a way for release) : Set a breakpoint and exploding "CrossMediaManager.Current.*" to look the properties , at that moment if I click on "continue" the streaming starts. There's no other way that worked for me on Android 12; the same code that doesn't work with 12 is working great with Android 11,10 and 9 and also with iOS.

I attach a short video to show what I mean with "trick"... https://user-images.githubusercontent.com/52449396/167838864-0ad037dc-99f5-41b0-a845-1d876cf9cb05.mp4

Anyone can help with this??

Originally posted by @lobons in https://github.com/Baseflow/XamarinMediaManager/issues/845#issuecomment-1123632231

Rhyno950 commented 2 years ago

Can confirm I am seeing the exact same behavior and the breakpoint trick does indeed get the stream going.

lobons commented 2 years ago

Well, not really well, but at least I'm not the only one with this problem; I still can't get it working on Android12. Maybe I'm missing something with the pending intent? because I created one, but I'm still receiving the "flag immutable advice" in the output. (I tried using CrossMediaManager.Android.BuildSessionActivityPendingIntent() or setting SessionActivityPendingIntent but I'm still receiving the advice) I noticed in the output that when I explode CrossMediaManager.Current it prints this line: "[ExoPlayerImpl] Init **** [ExoPlayerLib/2.11.7] [emulator64_x86_64_arm64, sdk_gphone64_x86_64, Google, 31]"
and if I "continue" the stream appears and works fine, I can even stop and start it again .

An example of the output containing the line I indicated above: " [EGL_emulation] app_time_stats: avg=2757.38ms min=4.79ms max=21730.46ms count=8 [EGL_emulation] app_time_stats: avg=2.85ms min=1.67ms max=14.52ms count=36 [EGL_emulation] app_time_stats: avg=2.29ms min=1.85ms max=3.53ms count=36 [EGL_emulation] app_time_stats: avg=2.23ms min=1.95ms max=3.44ms count=34 [EGL_emulation] app_time_stats: avg=2.20ms min=1.70ms max=4.23ms count=35 [EGL_emulation] app_time_stats: avg=2.60ms min=1.69ms max=16.65ms count=35 setDataSource failed: status = 0x80000000 [MediaMetadataRetrieverJNI] getEmbeddedPicture: Call to getEmbeddedPicture failed. [EGL_emulation] app_time_stats: avg=2.76ms min=1.74ms max=18.22ms count=36 [AppTest] Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (unsupported, reflection, allowed) [ExoPlayerImpl] Init 7ab128a [ExoPlayerLib/2.11.7] [emulator64_x86_64_arm64, sdk_gphone64_x86_64, Google, 31] [MediaHTTPService] MediaHTTPService(android.media.MediaHTTPService@e743806): Cookies: null [MediaHTTPService] makeHTTPConnection: CookieHandler (java.net.CookieManager@81d0e0a) exists. [MediaHTTPService] makeHTTPConnection(android.media.MediaHTTPService@e743806): cookieHandler: java.net.CookieManager@81d0e0a Cookies: null [Choreographer] Skipped 799 frames! The application may be doing too much work on its main thread. [MediaHTTPService] MediaHTTPService(android.media.MediaHTTPService@446a68c): Cookies: null

pasha-o commented 2 years ago

Hi @martijn00 since I opened the issue a year ago - this is not fixed. is it safe to assume this repo is no longer being watched to fix the issues?

martijn00 commented 2 years ago

https://github.com/Baseflow/ExoPlayerXamarin/pull/124 This was merged 2 days ago, and needed to fix this. You had a whole year to open a PR to fix this.

arahmancsd commented 1 year ago

This is a workaround to play in Android 12 #876