question: @ 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 = 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 ) ; if ( currentPlayerIsActive ) { if ( isInPlaybackState ( ) && isAlreadyPlayingTheFile ) { if ( SHOW_LOGS ) Logger . v ( TAG , "playNewVideo, videoPlayer " + videoPlayerView + " is already in state " + mCurrentPlayerState ) ; } else { startNewPlayback ( currentItemMetaData , videoPlayerView , videoUrl ) ; } } else { startNewPlayback ( currentItemMetaData , videoPlayerView , videoUrl ) ; } mPlayerHandler . resumeQueueProcessing ( TAG ) ; if ( SHOW_LOGS ) Logger . v ( TAG , "<< playNewVideo, videoPlayer " + videoPlayerView + ", videoUrl " + videoUrl ) ; }
target:  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