@Override public void playNewVideo(MetaData currentItemMetaData,VideoPlayerView videoPlayerView,String videoUrl){
  if (SHOW_LOGS)   Logger.v(TAG,">> playNewVideo, videoPlayer " + videoPlayerView + ", mCurrentPlayer "+ mCurrentPlayer+ ", videoPlayerView "+ videoPlayerView);
  mPlayerHandler.pauseQueueProcessing(TAG);
  boolean currentPlayerIsActive=currentItemMetaData.isMorePlayView() && mCurrentPlayer == videoPlayerView;
  boolean isAlreadyPlayingTheFile=mCurrentPlayer != null && videoUrl.equals(mCurrentPlayer.getVideoUrlDataSource());
  if (SHOW_LOGS)   Logger.v(TAG,"playNewVideo, isAlreadyPlayingTheFile " + isAlreadyPlayingTheFile);
  if (SHOW_LOGS)   Logger.v(TAG,"playNewVideo, currentPlayerIsActive " + currentPlayerIsActive);
  startNewPlayback(currentItemMetaData,videoPlayerView,videoUrl);
  mPlayerHandler.resumeQueueProcessing(TAG);
  if (SHOW_LOGS)   Logger.v(TAG,"<< playNewVideo, videoPlayer " + videoPlayerView + ", videoUrl "+ videoUrl);
}

@ Override public void playNewVideo ( MetaData currentItemMetaData , VideoPlayerView videoPlayerView , String videoUrl ) { if ( SHOW_LOGS ) Logger . v ( TAG , ">> playNewVideo, videoPlayer " + videoPlayerView + ", mCurrentPlayer " + mCurrentPlayer + ", videoPlayerView " + videoPlayerView ) ; mPlayerHandler . pauseQueueProcessing ( TAG ) ; boolean currentPlayerIsActive = currentItemMetaData . isMorePlayView ( ) && mCurrentPlayer == videoPlayerView ; boolean isAlreadyPlayingTheFile = mCurrentPlayer != null && videoUrl . equals ( mCurrentPlayer . getVideoUrlDataSource ( ) ) ; if ( SHOW_LOGS ) Logger . v ( TAG , "playNewVideo, isAlreadyPlayingTheFile " + isAlreadyPlayingTheFile ) ; if ( SHOW_LOGS ) Logger . v ( TAG , "playNewVideo, currentPlayerIsActive " + currentPlayerIsActive ) ; startNewPlayback ( currentItemMetaData , videoPlayerView , videoUrl ) ; mPlayerHandler . resumeQueueProcessing ( TAG ) ; if ( SHOW_LOGS ) Logger . v ( TAG , "<< playNewVideo, videoPlayer " + videoPlayerView + ", videoUrl " + videoUrl ) ; }
call it if you have direct url or path to video source the logic is following : 1 . stop queue processing to have consistent state of queue when posting new messages 2 . check if current player is active . 3 . if it is active and already playing current video we do nothing 4 . if not active then start new playback 5 . resume stopped queue
