在onPrepared()中暂停流在另一个方法中恢复

时间:2013-05-23 18:21:25

标签: java android stream android-mediaplayer

嗨我正在尝试在加载后暂停在线流的音乐,然后以其他方法恢复它。

public class OnPreparedHandler implements OnPreparedListener {

    @Override
    public void onPrepared( MediaPlayer mp ) {
        Log.d(TAG_NAME, "Entered Prepared State: Starting media player..." );

        Log.d(TAG_NAME, "Starting media player..." );
        Intent intent = new Intent( ACTION_NEW_SONG_STARTED );
        context.sendBroadcast( intent );
        mediaPlayer.start();
        mediaPlayer.pause();

    }
}

我在发言后正在广播中恢复

    prompt = getPrompt("p32280ex010B", station.getTitle()); 
    speak(prompt);
    startMediaPlayer();
    break;

我第一次加载一个流时效果很好,但是第二次得到

       05-23 14:15:49.872: E/MediaPlayer(18736): start called in state 4
       05-23 14:15:49.872: E/MediaPlayer(18736): error (-38, 0)
       05-23 14:15:49.872: E/MediaPlayer(18736): Error (-38,0)

我对此进行了广泛的研究而没有运气

0 个答案:

没有答案