Home
last modified time | relevance | path

Searched refs:mMediaPlayer (Results 1 – 7 of 7) sorted by relevance

/development/samples/browseable/MediaBrowserService/src/com.example.android.mediabrowserservice/
DPlayback.java76 private MediaPlayer mMediaPlayer; field in Playback
137 return mPlayOnFocusGain || (mMediaPlayer != null && mMediaPlayer.isPlaying()); in isPlaying()
141 return mMediaPlayer != null ? in getCurrentStreamPosition()
142 mMediaPlayer.getCurrentPosition() : mCurrentPosition; in getCurrentStreamPosition()
156 if (mState == PlaybackState.STATE_PAUSED && !mediaHasChanged && mMediaPlayer != null) { in play()
171 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); in play()
172 mMediaPlayer.setDataSource(source); in play()
179 mMediaPlayer.prepareAsync(); in play()
202 if (mMediaPlayer != null && mMediaPlayer.isPlaying()) { in pause()
203 mMediaPlayer.pause(); in pause()
[all …]
/development/samples/ApiDemos/src/com/example/android/apis/media/
DMediaPlayerDemo_Audio.java31 private MediaPlayer mMediaPlayer; field in MediaPlayerDemo_Audio
70 mMediaPlayer = new MediaPlayer(); in playAudio()
71 mMediaPlayer.setDataSource(path); in playAudio()
72 mMediaPlayer.prepare(); in playAudio()
73 mMediaPlayer.start(); in playAudio()
80 mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr); in playAudio()
81 mMediaPlayer.start(); in playAudio()
96 if (mMediaPlayer != null) { in onDestroy()
97 mMediaPlayer.release(); in onDestroy()
98 mMediaPlayer = null; in onDestroy()
DMediaPlayerDemo_Video.java42 private MediaPlayer mMediaPlayer; field in MediaPlayerDemo_Video
122 mMediaPlayer = new MediaPlayer(); in playVideo()
123 mMediaPlayer.setDataSource(path); in playVideo()
124 mMediaPlayer.setDisplay(holder); in playVideo()
125 mMediaPlayer.prepare(); in playVideo()
126 mMediaPlayer.setOnBufferingUpdateListener(this); in playVideo()
127 mMediaPlayer.setOnCompletionListener(this); in playVideo()
128 mMediaPlayer.setOnPreparedListener(this); in playVideo()
129 mMediaPlayer.setOnVideoSizeChangedListener(this); in playVideo()
130 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); in playVideo()
[all …]
DAudioFxDemo.java49 private MediaPlayer mMediaPlayer; field in AudioFxDemo
72 mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr); in onCreate()
73 Log.d(TAG, "MediaPlayer audio session ID: " + mMediaPlayer.getAudioSessionId()); in onCreate()
85 mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { in onCreate()
91 mMediaPlayer.start(); in onCreate()
98 mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId()); in setupEqualizerFxAndUI()
173 mVisualizer = new Visualizer(mMediaPlayer.getAudioSessionId()); in setupVisualizerFxAndUI()
189 if (isFinishing() && mMediaPlayer != null) { in onPause()
192 mMediaPlayer.release(); in onPause()
193 mMediaPlayer = null; in onPause()
/development/samples/browseable/FindMyPhone/Application/src/com.example.android.wearable.findphone/
DSoundAlarmListenerService.java45 private MediaPlayer mMediaPlayer; field in SoundAlarmListenerService
54 mMediaPlayer = new MediaPlayer(); in onCreate()
61 mMediaPlayer.release(); in onDestroy()
78 mMediaPlayer.reset(); in onDataChanged()
81 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); in onDataChanged()
83 mMediaPlayer.setDataSource(getApplicationContext(), mAlarmSound); in onDataChanged()
84 mMediaPlayer.prepare(); in onDataChanged()
88 mMediaPlayer.start(); in onDataChanged()
92 if (mMediaPlayer.isPlaying()) { in onDataChanged()
93 mMediaPlayer.stop(); in onDataChanged()
/development/samples/browseable/MediaRouter/src/com.example.android.mediarouter/player/
DLocalPlayer.java64 private MediaPlayer mMediaPlayer; field in LocalPlayer
102 if (mMediaPlayer != null) { in release()
103 mMediaPlayer.stop(); in release()
104 mMediaPlayer.release(); in release()
105 mMediaPlayer = null; in release()
118 mMediaPlayer.setDataSource(mContext, item.getUri()); in play()
119 mMediaPlayer.prepareAsync(); in play()
143 mMediaPlayer.seekTo(pos); in seek()
157 item.setDuration(mMediaPlayer.getDuration()); in getStatus()
159 mSeekToPos : mMediaPlayer.getCurrentPosition()); in getStatus()
[all …]
/development/samples/browseable/WearSpeakerSample/src/com.example.android.wearable.speaker/
DMainActivity.java53 private MediaPlayer mMediaPlayer; field in MainActivity
154 if (mMediaPlayer == null) { in playMusic()
155 mMediaPlayer = MediaPlayer.create(this, R.raw.sound); in playMusic()
156 mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { in playMusic()
165 mMediaPlayer.start(); in playMusic()
172 if (mMediaPlayer != null) { in stopMusic()
173 mMediaPlayer.stop(); in stopMusic()
174 mMediaPlayer.release(); in stopMusic()
175 mMediaPlayer = null; in stopMusic()
257 if (mMediaPlayer != null) { in onStop()
[all …]