summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/VideoView.java
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2015-03-12 16:17:45 -0700
committerMarco Nelissen <marcone@google.com>2015-03-12 16:17:45 -0700
commita80ac05f85962949d5072831200d86a7023575fb (patch)
tree38dc9f9fc058ff52ee76e2e82df9e01edccb6b6f /core/java/android/widget/VideoView.java
parentd58617b4f519e69cf8a828210f138d2bcbe4e20a (diff)
parent42f55d1e689c510198b62a1747a5fd8f8dcbff9b (diff)
downloadframeworks_base-a80ac05f85962949d5072831200d86a7023575fb.zip
frameworks_base-a80ac05f85962949d5072831200d86a7023575fb.tar.gz
frameworks_base-a80ac05f85962949d5072831200d86a7023575fb.tar.bz2
resolved conflicts for merge of 42f55d1e to master
Change-Id: I9c26861c5b0e26bb55e50b2133b7561348a01aec
Diffstat (limited to 'core/java/android/widget/VideoView.java')
-rw-r--r--core/java/android/widget/VideoView.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/widget/VideoView.java b/core/java/android/widget/VideoView.java
index 9d6ba57..2671739 100644
--- a/core/java/android/widget/VideoView.java
+++ b/core/java/android/widget/VideoView.java
@@ -302,6 +302,8 @@ public class VideoView extends SurfaceView
mMediaPlayer = null;
mCurrentState = STATE_IDLE;
mTargetState = STATE_IDLE;
+ AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
+ am.abandonAudioFocus(null);
}
}
@@ -310,12 +312,13 @@ public class VideoView extends SurfaceView
// not ready for playback just yet, will try again later
return;
}
- AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
- am.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
-
// we shouldn't clear the target state, because somebody might have
// called start() previously
release(false);
+
+ AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
+ am.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
+
try {
mMediaPlayer = new MediaPlayer();
// TODO: create SubtitleController in MediaPlayer, but we need
@@ -641,6 +644,8 @@ public class VideoView extends SurfaceView
if (cleartargetstate) {
mTargetState = STATE_IDLE;
}
+ AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
+ am.abandonAudioFocus(null);
}
}