@Override public void startStream() { if (streamingListener == null) { streamingListener = (StreamingListener) mSectionsPagerAdapter.getFragment(0); } if (streamingListener != null) { streamingListener.onStreamingStart(); } if (mediaPlayer == null) { mediaPlayer = new AACPlayer(this); mediaPlayer.setAudioBufferCapacityMs(3000); mediaPlayer.setDecodeBufferCapacityMs(1500); // untuk mencegak proses koneksi berulang pada protokol ICY // (Shoutcast streaming) mediaPlayer.setResponseCodeCheckEnabled(false); } if (mediaPlayer != null) { mediaPlayer.playAsync(RADIO_CHANNEL, 32); } }
@Override public void pauseStream() { hasBeenPaused = true; if (mediaPlayer != null) { mediaPlayer.stop(); } }