Answers for "android mediacontroller example"

0

android java mediacontroller example

private void play() {
	mProgressBar.setVisibility(View.VISIBLE);
	Uri videoUri = Uri.parse(mVideoUrl);
	try {
		mVideoView.setOnCompletionListener(this);
		mVideoView.setOnPreparedListener(this);
		mVideoView.setOnErrorListener(this);
		mVideoView.setVideoURI(videoUri);
		mMediaController = new MediaController(this);
		mMediaController.setAnchorView(mVideoView);
		mMediaController.setMediaPlayer(mVideoView);
		if (!mControls) {
			mMediaController.setVisibility(View.GONE);
		}
		mVideoView.setMediaController(mMediaController);
	} catch (Throwable t) {
		Log.d(TAG, t.toString());
	}
}
Posted by: Guest on April-15-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language