Skip to content

Commit

Permalink
Added a null reference check to MediaPlayerService.OnAudioFocusChange…
Browse files Browse the repository at this point in the history
…() in the LossTransientCanDuck case.
  • Loading branch information
jmartine2 committed Oct 5, 2016
1 parent 7d43dcc commit 65b0bd3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,10 @@ public void OnAudioFocusChange(AudioFocus focusChange)
Pause();
break;
case AudioFocus.LossTransientCanDuck:
//We have lost focus but should till play at a muted 10% volume
//We have lost focus but should still play at a muted 10% volume
if (mediaPlayer == null)
return;

if (mediaPlayer.IsPlaying)
mediaPlayer.SetVolume(.1f, .1f);//turn it down!
break;
Expand Down
104 changes: 38 additions & 66 deletions Sample/MediaSample.Droid/Resources/Resource.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65b0bd3

Please sign in to comment.