/development/samples/ApiDemos/src/com/example/android/apis/media/ |
MediaPlayerDemo_Audio.java | 31 private MediaPlayer mMediaPlayer; 70 mMediaPlayer = new MediaPlayer(); 71 mMediaPlayer.setDataSource(path); 72 mMediaPlayer.prepare(); 73 mMediaPlayer.start(); 80 mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr); 81 mMediaPlayer.start(); 96 if (mMediaPlayer != null) { 97 mMediaPlayer.release(); 98 mMediaPlayer = null [all...] |
MediaPlayerDemo_Video.java | 42 private MediaPlayer mMediaPlayer; 122 mMediaPlayer = new MediaPlayer(); 123 mMediaPlayer.setDataSource(path); 124 mMediaPlayer.setDisplay(holder); 125 mMediaPlayer.prepare(); 126 mMediaPlayer.setOnBufferingUpdateListener(this); 127 mMediaPlayer.setOnCompletionListener(this); 128 mMediaPlayer.setOnPreparedListener(this); 129 mMediaPlayer.setOnVideoSizeChangedListener(this); 130 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC) [all...] |
AudioFxDemo.java | 49 private MediaPlayer mMediaPlayer; 72 mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr); 73 Log.d(TAG, "MediaPlayer audio session ID: " + mMediaPlayer.getAudioSessionId()); 85 mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 91 mMediaPlayer.start(); 98 mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId()); 173 mVisualizer = new Visualizer(mMediaPlayer.getAudioSessionId()); 189 if (isFinishing() && mMediaPlayer != null) { 192 mMediaPlayer.release(); 193 mMediaPlayer = null [all...] |
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/ |
MediaPlayerStateUnitTestTemplate.java | 47 private MediaPlayer mMediaPlayer = null; 90 assertTrue(mInitialized); // mMediaPlayer has been initialized? 107 // Set up a looper to be used by mMediaPlayer. 114 mMediaPlayer = new MediaPlayer(); 115 mMediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { 129 mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 158 mMethodUnderTest.invokeMethodUnderTest(mMediaPlayer); 176 mMediaPlayer.reset(); 177 mMediaPlayer.setDataSource(TEST_PATH); 178 mMediaPlayer.prepare() [all...] |
/cts/tests/tests/media/src/android/media/cts/ |
MediaPlayerStreamingTest.java | 156 mMediaPlayer.setDataSource(stream_url); 158 mMediaPlayer.setDisplay(getActivity().getSurfaceHolder()); 159 mMediaPlayer.setScreenOnWhilePlaying(true); 162 mMediaPlayer.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() { 168 mMediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { 177 mMediaPlayer.prepare(); 180 mMediaPlayer.start(); 182 assertFalse(mMediaPlayer.isPlaying()); 185 mMediaPlayer.start(); 188 mMediaPlayer.stop() [all...] |
MediaPlayerTestBase.java | 78 protected MediaPlayer mMediaPlayer = new MediaPlayer(); 93 if (mMediaPlayer != null) { 94 mMediaPlayer.release(); 102 mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), 122 mMediaPlayer.setDataSource(path); 151 mMediaPlayer.setDisplay(getActivity().getSurfaceHolder()); 152 mMediaPlayer.setScreenOnWhilePlaying(true); 153 mMediaPlayer.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() { 165 mMediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { 173 mMediaPlayer.prepare() [all...] |
MediaPlayerTest.java | 41 mMediaPlayer.setDataSource((String) null); 117 mMediaPlayer.start(); 120 int posBefore = mMediaPlayer.getCurrentPosition(); 121 mMediaPlayer.setDisplay(getActivity().getSurfaceHolder2()); 122 int posAfter = mMediaPlayer.getCurrentPosition(); 125 assertTrue(mMediaPlayer.isPlaying()); 129 mMediaPlayer.seekTo(seekPos); 132 posBefore = mMediaPlayer.getCurrentPosition(); 133 mMediaPlayer.setDisplay(null); 134 posAfter = mMediaPlayer.getCurrentPosition() [all...] |
AudioEffectTest.java | 62 private MediaPlayer mMediaPlayer = null; 381 assertTrue(mInitialized); // mMediaPlayer has been initialized? 385 mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); 391 mMediaPlayer.attachAuxEffect(mEffect.getId()); 392 mMediaPlayer.setAuxEffectSendLevel(1.0f); 435 assertTrue(mInitialized); // mMediaPlayer has been initialized? 442 mMediaPlayer.attachAuxEffect(mEffect.getId()); [all...] |
/frameworks/base/core/java/android/webkit/ |
HTML5Audio.java | 50 private MediaPlayer mMediaPlayer; 123 if (mState != ERROR && mMediaPlayer.isPlaying()) { 124 int position = mMediaPlayer.getCurrentPosition(); 191 if (mMediaPlayer == null) { 192 mMediaPlayer = new MediaPlayer(); 194 mMediaPlayer.reset(); 196 mMediaPlayer.setOnBufferingUpdateListener(this); 197 mMediaPlayer.setOnCompletionListener(this); 198 mMediaPlayer.setOnErrorListener(this); 199 mMediaPlayer.setOnPreparedListener(this) [all...] |
/frameworks/base/core/java/android/widget/ |
VideoView.java | 75 private MediaPlayer mMediaPlayer = null; 189 if (mMediaPlayer != null) { 190 mMediaPlayer.stop(); 191 mMediaPlayer.release(); 192 mMediaPlayer = null; 213 mMediaPlayer = new MediaPlayer(); 214 mMediaPlayer.setOnPreparedListener(mPreparedListener); 215 mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener); 217 mMediaPlayer.setOnCompletionListener(mCompletionListener); 218 mMediaPlayer.setOnErrorListener(mErrorListener) [all...] |
/cts/tests/src/android/media/cts/ |
AudioManagerStub.java | 31 private MediaPlayer mMediaPlayer; 43 mMediaPlayer = MediaPlayer.create(this, MP3_TO_PLAY); 44 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 45 mMediaPlayer.setLooping(false); 46 mMediaPlayer.start(); 86 mMediaPlayer.stop(); 87 mMediaPlayer.release();
|
MediaPlayerSurfaceStubActivity.java | 34 private MediaPlayer mMediaPlayer = null; 41 mMediaPlayer = new MediaPlayer(); 45 mMediaPlayer.setDataSource( 52 mVideoView = new VideoSurfaceView(this, mMediaPlayer);
|
VideoSurfaceView.java | 43 private MediaPlayer mMediaPlayer = null; 49 mMediaPlayer = mp; 58 mRenderer.setMediaPlayer(mMediaPlayer); 66 mMediaPlayer.start(); 69 mMediaPlayer.setSurface(null); 71 while (mMediaPlayer.isPlaying()) { 129 private MediaPlayer mMediaPlayer; 141 mMediaPlayer = player; 238 mMediaPlayer.setSurface(surface); 242 mMediaPlayer.prepare() [all...] |
/packages/apps/Mms/src/com/android/mms/ui/ |
AudioAttachmentView.java | 50 private MediaPlayer mMediaPlayer; 78 if (mMediaPlayer != null) { 80 mMediaPlayer.stop(); 81 mMediaPlayer.release(); 83 mMediaPlayer = null; 90 mMediaPlayer = MediaPlayer.create(mContext, mAudioUri); 91 if (mMediaPlayer != null) { 92 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 93 mMediaPlayer.setOnCompletionListener(new OnCompletionListener() { 98 mMediaPlayer.setOnErrorListener(new OnErrorListener() [all...] |
/system/media/mca/filterpacks/videosrc/java/ |
MediaSource.java | 98 private MediaPlayer mMediaPlayer; 224 if (mMediaPlayer == null) { 251 mMediaPlayer.release(); 256 mMediaPlayer.start(); 348 if (mMediaPlayer.isPlaying()) { 349 mMediaPlayer.stop(); 358 mMediaPlayer.release(); 359 mMediaPlayer = null; 397 mMediaPlayer.setLooping(mLooping); 410 mMediaPlayer.setVolume(mVolume, mVolume) [all...] |
/packages/apps/DeskClock/src/com/android/deskclock/ |
AlarmKlaxon.java | 50 private MediaPlayer mMediaPlayer; 173 // TODO: Reuse mMediaPlayer instead of creating a new one and/or use 175 mMediaPlayer = new MediaPlayer(); 176 mMediaPlayer.setOnErrorListener(new OnErrorListener() { 181 mMediaPlayer = null; 192 mMediaPlayer.setVolume(IN_CALL_VOLUME, IN_CALL_VOLUME); 193 setDataSourceFromResource(getResources(), mMediaPlayer, 196 mMediaPlayer.setDataSource(this, alert); 198 startAlarm(mMediaPlayer); 205 mMediaPlayer.reset() [all...] |
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/ |
CellBroadcastAlertAudio.java | 84 private MediaPlayer mMediaPlayer; 260 mMediaPlayer = new MediaPlayer(); 261 mMediaPlayer.setOnErrorListener(new OnErrorListener() { 266 mMediaPlayer = null; 277 mMediaPlayer.setVolume(IN_CALL_VOLUME, IN_CALL_VOLUME); 279 setDataSourceFromResource(getResources(), mMediaPlayer, 283 startAlarm(mMediaPlayer); 327 if (mMediaPlayer != null) { 328 mMediaPlayer.stop(); 329 mMediaPlayer.release() [all...] |
/frameworks/base/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ |
ScoAudioTest.java | 323 private MediaPlayer mMediaPlayer; 346 Log.e(TAG, "playOrPause playing: "+((mMediaPlayer == null)?false:!mMediaPlayer.isPlaying())+ 347 " mMediaPlayer: "+mMediaPlayer+ 350 if (mMediaPlayer == null || !mMediaPlayer.isPlaying()){ 351 if (mMediaPlayer == null) { 357 mMediaPlayer = new MediaPlayer(); 361 mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()) [all...] |
/frameworks/base/media/tests/MediaDump/src/com/android/mediadump/ |
VideoDumpView.java | 71 private MediaPlayer mMediaPlayer = null; 130 mMediaPlayer = new MediaPlayer(); 132 mMediaPlayer.setDataSource(VideoDumpConfig.VIDEO_URI); 155 mRenderer.setMediaPlayer(mMediaPlayer); 163 mMediaPlayer.start(); 167 mMediaPlayer.pause(); 178 if (mMediaPlayer != null) { 179 mMediaPlayer.stop(); 180 mMediaPlayer.release(); 181 mMediaPlayer = null [all...] |
/system/media/wilhelm/tests/native-media/src/com/example/nativemedia/ |
NativeMedia.java | 48 MediaPlayer mMediaPlayer; 123 mMediaPlayer = new MediaPlayer(); 126 mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { 141 mMediaPlayer.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() { 225 mSelectedVideoSink.useAsSinkForJava(mMediaPlayer); 231 mMediaPlayer.setDataSource(mSourceString); 235 mMediaPlayer.prepareAsync(); 237 } else if (mMediaPlayer.isPlaying()) { 238 mMediaPlayer.pause(); 240 mMediaPlayer.start() [all...] |
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/ |
CodecTest.java | 49 private static MediaPlayer mMediaPlayer; 272 mMediaPlayer.setDataSource(filePath); 273 mMediaPlayer.setDisplay(MediaFrameworkTest.mSurfaceView.getHolder()); 274 mMediaPlayer.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener); 277 mMediaPlayer.prepare(); 278 mMediaPlayer.start(); 284 videoHeight = mMediaPlayer.getVideoHeight(); 308 mMediaPlayer.setDataSource(filePath); 309 mMediaPlayer.setDisplay(MediaFrameworkTest.mSurfaceView.getHolder()); 310 mMediaPlayer.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener) [all...] |
/packages/apps/Music/src/com/android/music/ |
MusicPicker.java | 153 MediaPlayer mMediaPlayer; 639 if (newId != mPlayingId || mMediaPlayer == null) { 641 mMediaPlayer = new MediaPlayer(); 643 mMediaPlayer.setDataSource(this, mSelectedUri); 644 mMediaPlayer.setOnCompletionListener(this); 645 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); 646 mMediaPlayer.prepare(); 647 mMediaPlayer.start(); 653 } else if (mMediaPlayer != null) { 660 if (mMediaPlayer == mp) [all...] |
MediaPlaybackService.java | [all...] |
/frameworks/base/media/java/android/media/ |
MediaPlayer.java | [all...] |
/cts/tests/tests/permission/src/android/permission/cts/ |
AudioPermissionTest.java | 37 MediaPlayer mMediaPlayer = null;
|