Skip to content

Commit

Permalink
Merge pull request #29 from jmartine2/master
Browse files Browse the repository at this point in the history
Fixed issues #27 and #28
  • Loading branch information
martijn00 authored Oct 12, 2016
2 parents ba50fa0 + bca6696 commit b87f45d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions MediaManager/Plugin.MediaManager.Android/MediaPlayerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,16 @@ public async Task Play()
Cover = await BitmapFactory.DecodeResourceAsync(Resources, Resource.Drawable.ButtonStar);
}
else
Cover = await BitmapFactory.DecodeByteArrayAsync(imageByteArray, 0, imageByteArray.Length);
{
try
{
Cover = await BitmapFactory.DecodeByteArrayAsync(imageByteArray, 0, imageByteArray.Length);
}
catch (Java.Lang.OutOfMemoryError)
{
Cover = null;
}
}
StartedPlayback = true;
}
catch (Exception ex)
Expand Down Expand Up @@ -934,7 +943,13 @@ private void ReleaseWifiLock()
if (wifiLock == null || !wifiLock.IsHeld)
return;

wifiLock.Release();
try
{
wifiLock.Release();
}
catch (Java.Lang.RuntimeException)
{ }

wifiLock = null;
}

Expand Down

0 comments on commit b87f45d

Please sign in to comment.