/** * Sets the Uri location for the video to play * * @param uri The video's Uri * @param defaultMediaType The MediaType to use when auto-detection fails */ public void setVideoURI(Uri uri, MediaUtil.MediaType defaultMediaType) { videoUri = uri; if (!useExo) { videoView.setVideoURI(uri); } else { if (uri == null) { emExoPlayer.replaceRenderBuilder(null); } else { emExoPlayer.replaceRenderBuilder( getRendererBuilder(VideoType.get(uri), uri, defaultMediaType)); listenerMux.setNotifiedCompleted(false); } // Makes sure the listeners get the onPrepared callback listenerMux.setNotifiedPrepared(false); emExoPlayer.seekTo(0); } if (defaultControls != null) { defaultControls.restartLoading(); } }