Baseflow / XamarinMediaManager

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

ArgumentOutOfRangeException @ Android #838

Open bodeg opened 2 years ago

bodeg commented 2 years ago

I am randomly encountering the following crash on Android

Any idea how can I can avoid that crash?

Xamarin Exception Stack:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) <0x78bd0e0e40 + 0x0007b> in <3856ff9d2a624b83b52be2f7528d1ab1>:0
  at System.Collections.ObjectModel.Collection`1[T].get_Item (System.Int32 index) <0x78bd0d2fc0 + 0x00063> in <3856ff9d2a624b83b52be2f7528d1ab1>:0
  at MediaManager.Queue.MediaQueue.get_Item (System.Int32 index) [0x00006] in <ffce075ced524aedb353017c075fcf1b>:0
  at System.Linq.Enumerable.ElementAtOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Int32 index) <0x78b96a6160 + 0x00117> in <a0b5ff96c0eb4e9db197097655c07eaf>:0
  at MediaManager.Platforms.Android.Media.MediaDescriptionAdapter.GetCurrentContentTextFormatted (Com.Google.Android.Exoplayer2.IPlayer player) [0x00011] in <ffce075ced524aedb353017c075fcf1b>:0
  at Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager+IMediaDescriptionAdapterInvoker.n_GetCurrentContentText_Lcom_google_android_exoplayer2_Player_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_p0) [0x00011] in <2a69df5e1b684529aaf6028d6e459c77>:0
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.89(intptr,intptr,intptr)