danylovolokh / VideoPlayerManager

This is a project designed to help controlling Android MediaPlayer class. It makes it easier to use MediaPlayer ListView and RecyclerView. Also it tracks the most visible item in scrolling list. When new item in the list become the most visible, this library gives an API to track it.
3.15k stars 747 forks source link

MessagesHandlerThread may blocked #57

Open wkq87 opened 7 years ago

wkq87 commented 7 years ago

In VideoPlayerView start method, object mReadyForPlaybackIndicator may wait all the time, try { mReadyForPlaybackIndicator.wait(); } catch (InterruptedException e) { throw new RuntimeException(e); } but sometimes the player may occur error while playing and no error callback,then the method may blocked forever. And this will cause MessagesHandlerThread blocked too. if (SHOW_LOGS) Logger.v(TAG, "run, mLastMessage " + mLastMessage); mLastMessage.runMessage(); if (SHOW_LOGS) Logger.v(TAG, "run, mLastMessage finished"); this make start method in VideoPlayerView becomes synchronized,so MessageHandler cannot work again even you start a new player. should we move this wait block to another place when we call method mReadyForPlaybackIndicator.notifyAll()?

zzhangxiaoyun commented 7 years ago

遇到了这个问题,有好的解决方案吗 @wkq87