/** manual preview */ public void manualPrev() throws IllegalStateException { if (mmediaplayer != null) { if (mplayerMode == VideoConst.PLAYER_MODE_HTTP) { throw new IllegalStateException("Can't do Prev!!!"); } if (videopl.getShuffleMode(Const.FILTER_VIDEO) == Const.SHUFFLE_ON || videopl.getRepeatMode(Const.FILTER_VIDEO) == Const.REPEAT_NONE) { if (videopl.getCurrentIndex(Const.FILTER_VIDEO) == 0) { throw new IllegalStateException("head of PlayList!!!"); } } saveProgress(getProgress()); if (mPlayStatus != VideoConst.PLAY_STATUS_STOPPED) { try { mmediaplayer.stop(); } catch (IllegalStateException e) { e.printStackTrace(); throw new IllegalStateException(e); } mPlayStatus = VideoConst.PLAY_STATUS_STOPPED; } mcurPath = videopl.getNext(Const.FILTER_VIDEO, Const.MANUALPRE); if (mcurPath == null) { MmpTool.LOG_DBG("End of PlayList!"); stop(); } MmpTool.LOG_DBG(mcurPath); mmediaplayer.reset(); mPlayStatus = VideoConst.PLAY_STATUS_END; try { setDataSource(mcurPath); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); throw new IllegalStateException(e); } try { play(); } catch (IllegalStateException e) { e.printStackTrace(); throw new IllegalStateException(e); } } }
private void autoNext() { if (mmediaplayer != null) { if (mplayerMode == VideoConst.PLAYER_MODE_HTTP) { MmpTool.LOG_ERROR("This player mode can't do next!"); throw new IllegalStateException("Can't do Next!!!"); } if (mPlayStatus != VideoConst.PLAY_STATUS_STOPPED) { mmediaplayer.stop(); mPlayStatus = VideoConst.PLAY_STATUS_STOPPED; } mcurPath = videopl.getNext(Const.FILTER_VIDEO, Const.AUTOPLAY); mmediaplayer.reset(); mPlayStatus = VideoConst.PLAY_STATUS_END; try { setDataSource(mcurPath); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } try { play(); } catch (IllegalStateException e) { e.printStackTrace(); } } }