2013-06-04 46 views
1

我做了一个流程序来播放一个广告+音频+广告。我打第一个广告罚款,然后我切换到音频罚款,然后我失败在播放最后一个广告,我得到错误(38,0)。我检查了我有设置数据源,onPrepareListener,我试着我可以找到的所有东西,但仍然在android 4.1.1上得到这个错误 我的方法MPStarting后我得到错误,我甚至没有达到最终的方法只为最后ad.if有任何信息需要更多plz让我知道谢谢。 这里是相关Android播放器错误(-38,0)

MPStarting(Track) 
{ try 
{ 
    if (_playlist !=null && _playlist.GetCurrent() != null) 
    {     
     Episode ep = (Episode) _playlist.GetCurrent(); 
     _player = new MediaPlayer(); 
     AdsInfo startAd = ep.getAdWithType(PlayTime.start_ad); 
     AdsInfo endAd = ep.getAdWithType(PlayTime.end_ad); 
     if(currAudio == null && startAd != null) 
      currAudio = startAd; 
     else if(currAudio == startAd) 
      currAudio = ep; 
     else if (currAudio instanceof Episode && endAd != null) 
      currAudio = ep.getAdWithType(PlayTime.end_ad); 
    } 
    if(_player != null) 
    { 
     _player.setDataSource(dataSource); 
     _player.setOnPreparedListener(this); 
     _player.setOnCompletionListener(this); 
     _player.setOnBufferingUpdateListener(this); 
     _player.setOnSeekCompleteListener(this); 
     _player.setOnErrorListener(this);   
     _player.prepareAsync(); 
    } 

    catch (Exception e) 
    { 
     Log.i("mpcPlayer","MPStarting "+ e.getLocalizedMessage()); 
    } 

} 
} 
@Override 
public void onCompletion(MediaPlayer mp) 
{ 
//here i check on current playing 
//i always stop player if it is playing ,reset,release and make player = null 
// then i call MPStarting and i send the current audio then return 
} 
+0

你是否正在播放Ad3 –

+0

串流mp3曲目,有时我从SDcard播放SD卡 –

+0

应该不是问题。当我们从流媒体服务器播放时,当mediaplayer超时缓冲过期时,我们通常会遇到此错误。如果可能的话,总是尝试从SD卡播放。 –

回答

0

我想我找到我的问题的代码的一部分,我有时调用getCurrentPosition()似乎球员没有准备好再寄一次猜这个错误有关调用的方法有时候玩家不在正确的状态。

相关问题