MediaPlayer make 1 lag after start

I create MediaPlayer object for playing a stream audio, from http url source. Every time when object starts to play audio after 3-4 seconds audio has stopped, buffering and play again, but only 1 time. Than all is good

Code :

String url = "http://icecast.vgtrk.cdnvideo.ru/vestifm_mp3_192kbps"; 
        audioPlayer = new MediaPlayer();
        audioPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mp) {
                    mp.start();
            }
        });
        try {
            //setProgressBarPlayer(Constants.ACTION_BUFFERING);
            audioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            audioPlayer.setDataSource(url);
            audioPlayer.prepareAsync();
            audioPlayer.setWakeMode(ctx, PowerManager.PARTIAL_WAKE_LOCK);

        } catch (IOException e) {
            e.printStackTrace();
        }

my LogCat is showed below

  • W/MediaPlayer﹕ info/warning (703, 0)
  • W/MediaPlayer﹕ info/warning (701, 0)
  • D/audio_hw_primary﹕ disable_audio_route: reset and update mixer path: low-latency-playback
  • D/audio_hw_primary﹕ disable_snd_device: snd_device(2: speaker) V/ConfigFetchTask﹕ ConfigFetchTask getDeviceDataVersionInfo(): ABFEt1 ...
  • I/GoogleURLConnFactory﹕ Using platform SSLCertificateSocketFactory
  • W/MediaPlayer﹕ info/warning (703, 0)
  • I/NuPlayer﹕ buffer ready, resuming...
  • W/MediaPlayer﹕ info/warning (702, 0)
  • 链接地址: http://www.djcxy.com/p/61392.html

    上一篇: 直播从网络摄像头或频道的Android

    下一篇: MediaPlayer在启动后有1次滞后