@Override public void onReceive(Context context, Intent intent) { MediaPlayerControl mediaPlayerControl = Player.getMediaPlayerControl(); if (mediaPlayerControl == null) { return; } TelephonyManager tm = (TelephonyManager) context .getSystemService(Service.TELEPHONY_SERVICE); switch (tm.getCallState()) { case TelephonyManager.CALL_STATE_RINGING: mediaPlayerControl.pause(); break; case TelephonyManager.CALL_STATE_IDLE: if (!mediaPlayerControl.isPlaying()) { mediaPlayerControl.start(); } break; } }
public void setMediaPlayer(MediaPlayerControl player) { this.mPlayer = player; updatePausePlay(); }
public void setMediaPlayer(MediaPlayerControl player) { mPlayer = player; updatePausePlay(); }
public void setMediaPlayer(MediaPlayerControl player) { mPlayer = player; mHandler.sendEmptyMessage(SHOW_PROGRESS); updatePausePlay(); }
@Override public MediaPlayerControl getMediaPlayerControl() { return this; }
static MediaPlayerControl getMediaPlayerControl() { return mediaPlayerControl; }
void setMediaPlayer(MediaPlayerControl mediaPlayerControl);
MediaPlayerControl getMediaPlayerControl();