7
我嘗試使用MediaPlayer(Android ICS)循環播放多個視頻,並在每次調用oncompletion()時更改視頻。setVideoSurfaceTexture失敗:在媒體播放器中爲-1234
它的偉大工程,但隨機時間的申請,凍結後,我得到的錯誤:
[SurfaceView]連接:已連接(CUR = 3,REQ = 3) setVideoSurfaceTexture失敗:-22
當這個錯誤發生,在內部調用它的復位玩家
裁判:mediaplayer.cpp
if (err != OK) {
LOGE("setVideoSurfaceTexture failed: %d", err);
// Note that we must do the reset before disconnecting from the ANW.
// Otherwise queue/dequeue calls could be made on the disconnected
// ANW, which may result in errors.
reset();
disconnectNativeWindow();
return err;
}
根據我的代碼,我得到onprepared()的通知並開始播放。
實際上由於這個錯誤沒有播放。所以我嘗試重置媒體播放器並調用prepare(),當這個問題發生,mediaplayer不播放,但我無法捕捉到這個bug(mp.isPlaying() - > true(bec'z called start ()在onprepared())。
我試着像
onprepared() {
mp.start();
if (pbm : [SurfaceView] connect : already connected (cur=3, req=3)
setVideoSurfaceTexture failed : -22 ) {
reset the mediaplayer source and call prepare
}
}
邏輯我怎麼能找到這個bug重新啓動媒體播放器再次?