Best code examples for Android VideoView class (android.widget.VideoView)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android VideoView class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android VideoView examples from Open Source projects
This code example shows how to use the following methods: setVideoURI, start
54:	mVideoView.setVideoURI(Uri.parse(url)); 
55:	mVideoView.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: isPlaying, start
138:	if ( mVideoView.isPlaying ()) { 
-
143:	mVideoView.start (); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: canSeekForward, getDuration, isPlaying, seekTo, start
50:	if(videoPlayer.canSeekForward()) videoPlayer.seekTo(videoPlayer.getDuration()/5); 
51:	videoPlayer.start(); 
52:	Log.i("IS PLAYING", Boolean.toString(videoPlayer.isPlaying())); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMediaController, setOnCompletionListener, setVideoURI, start
19:	t = new VideoView(EpicAndroidActivity.getCurrentAndroidActivity()); 
20:	t.setOnCompletionListener(this); 
-
22:	t.setVideoURI(this.location); 
23:	t.setMediaController(new MediaController(EpicAndroidActivity.getCurrentAndroidActivity())); 
-
25:	t.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnCompletionListener, setVideoURI
39:	video = new VideoView(GameActivity.getContext()); 
40:	video.setOnCompletionListener(this); 
-
43:	GameActivity.pushView(video); 
-
52:	video.setVideoURI(Utils.buildResourceUri(GameActivity.getContext(), GameActivity.getResourceID(resourcePath))); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMediaController, setOnCompletionListener, setOnErrorListener, setOnPreparedListener
112:	videoView.setOnPreparedListener(this); 
113:	videoView.setOnErrorListener(this); 
114:	videoView.setOnCompletionListener(this); 
-
116:	videoView.setMediaController(controller); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDuration, start
36:	int duration = mVideoView.getDuration(); 
-
42:	mVideoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVideoURI, start
112:	videoView.setVideoURI(Uri.parse(new File(video 
-
114:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying
71:	if (mVideoView.isPlaying()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, isPlaying, stopPlayback
218:	setBookmark(mVideoView.getCurrentPosition()); 
-
220:	mPositionWhenPaused = mVideoView.getCurrentPosition(); 
221:	mWasPlayingWhenPaused = mVideoView.isPlaying(); 
222:	mVideoView.stopPlayback(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying, setMediaController, setVideoPath, start, stopPlayback
41:	videoView.stopPlayback(); 
-
70:	if (!this.videoView.isPlaying()) { 
71:	this.videoView.setVideoPath(content_unit.getMovieFile() 
-
73:	this.videoView.setMediaController(new MediaController(getActivity())); 
74:	this.videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: seekTo, setVideoPath
49:	VideoView result=new VideoView(getActivity()); 
-
51:	result.setVideoPath(getArguments().getString(ARG_PATH)); 
-
54:	result.seekTo(savedInstanceState.getInt(STATE_POSITION)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath
27:	VideoView v = new VideoView(this); 
-
30:	v.setVideoPath(s); 
31:	v.setMediaController(new MediaController(this)); 
32:	v.requestFocus(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoURI, start
48:	videoView1.setMediaController(new MediaController(this)); 
-
50:	videoView1.setVideoURI(Uri.parse(path+"/"+fileName)); 
-
52:	videoView1.requestFocus(); 
-
54:	videoView1.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, getDuration, stopPlayback
52:	mPositionWhenPaused = mVideoView.getCurrentPosition(); 
53:	mVideoView.stopPlayback(); 
-
55:	Log.d(TAG, "OnStop: getDuration  = " + mVideoView.getDuration()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, getDuration, isPlaying, pause, seekTo
177:	mVideoPosition = mVideoView.getCurrentPosition(); 
-
181:	mVideoView.seekTo(mTrimStartTime); 
-
188:	mVideoView.seekTo(mTrimEndTime); 
-
192:	mVideoView.pause(); 
-
195:	int duration = mVideoView.getDuration(); 
-
204:	mVideoView.start(); 
-
210:	mVideoView.pause(); 
-
287:	if (mVideoView.isPlaying()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoURI, start
15:	VideoView videoHolder = new VideoView(this); 
-
17:	videoHolder.setMediaController(new MediaController(this)); 
-
19:	videoHolder.setVideoURI(Uri.parse(path+"/"+fileName)); 
-
21:	videoHolder.requestFocus(); 
-
23:	videoHolder.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath, start
18:	VideoView vv = new VideoView(getApplicationContext()); 
-
20:	vv.setVideoPath(filename); 
21:	vv.setMediaController(new MediaController(this)); 
22:	vv.requestFocus(); 
23:	vv.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMinimumHeight, setMinimumWidth, setMediaController, setVideoPath
21:	VideoView vv = new VideoView(getApplicationContext()); 
-
23:	vv.setVideoPath(filename); 
24:	vv.setMinimumHeight(480); 
25:	vv.setMinimumWidth(800); 
26:	vv.setMediaController(new MediaController(this)); 
27:	vv.requestFocus(); 
28:	vv.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnCompletionListener, setVideoPath, start
49:	VideoView videoView = new VideoView(this); 
50:	videoView.setOnCompletionListener(new OnCompletionListener() { 
-
61:	videoView.setVideoPath(path); 
62:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMediaController, setOnCompletionListener, setOnPreparedListener, setVideoPath
26:	mVideoView.setOnCompletionListener(this); 
27:	mVideoView.setOnPreparedListener(this); 
-
37:	mVideoView.setVideoPath(mVideoFileName); 
38:	mVideoView.setMediaController(mController); 
-
85:	mVideoView = new VideoView(this); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setMediaController, setVideoURI, start
45:	videoView.setVideoURI(Uri.parse(videoPath)); 
-
47:	videoView.setMediaController(new MediaController(this)); 
-
49:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setOnPreparedListener, setVideoURI, start
50:	myVideoView.requestFocus(); 
51:	myVideoView.start(); 
-
57:	myVideoView.setVideoURI(defaultVideofile); 
-
59:	myVideoView.setMediaController(new MediaController(this)); 
-
61:	myVideoView.setOnPreparedListener(new OnPreparedListener() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoURI, start
47:	videoView1.setMediaController(new MediaController(this)); 
-
49:	videoView1.setVideoURI(Uri.parse(path+"/"+fileName)); 
-
51:	videoView1.requestFocus(); 
-
54:	videoView1.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVideoURI
69:	mVideoView.setVideoURI(uri); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, getDuration, isPlaying, pause, seekTo
177:	mVideoPosition = mVideoView.getCurrentPosition(); 
-
181:	mVideoView.seekTo(mTrimStartTime); 
-
188:	mVideoView.seekTo(mTrimEndTime); 
-
192:	mVideoView.pause(); 
-
195:	int duration = mVideoView.getDuration(); 
-
204:	mVideoView.start(); 
-
210:	mVideoView.pause(); 
-
287:	if (mVideoView.isPlaying()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath, start
19:	VideoView vv = new VideoView(getApplicationContext()); 
-
21:	vv.setVideoPath(filename); 
22:	vv.setMediaController(new MediaController(this)); 
23:	vv.requestFocus(); 
24:	vv.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: seekTo, setVideoPath, start
44:	vv.setVideoPath("android.resource://jp.alumican.speechdemo/"+video_src); 
45:	vv.seekTo(0); 
46:	vv.start(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setMediaController, setVideoURI, start
22:	videoView = new VideoView(this); 
-
24:	videoView.setVideoURI( Uri.fromFile(new File(Environment.getExternalStorageDirectory(),"MysticHigh.mp4")) ); 
-
26:	videoView.setMediaController(controller); 
27:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoURI, start
47:	videoView1.setMediaController(new MediaController(this)); 
-
49:	videoView1.setVideoURI(Uri.parse(path+"/"+fileName)); 
-
51:	videoView1.requestFocus(); 
-
54:	videoView1.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setOnPreparedListener, setVideoURI, start
58:	myVideoView.setMediaController(new MediaController(this)); 
-
60:	myVideoView.setOnPreparedListener(new OnPreparedListener() { 
-
67:	myVideoView.requestFocus(); 
68:	myVideoView.start(); 
-
76:	myVideoView.setVideoURI(defaultVideofile); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath, start
15:	VideoView vv = new VideoView(getApplicationContext()); 
-
20:	vv.setVideoPath(ss); 
-
22:	vv.setMediaController(new MediaController(this)); 
23:	vv.requestFocus(); 
24:	vv.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVideoURI
78:	mVideoView.setVideoURI(uri); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setOnPreparedListener, setVideoURI, start
64:	introVideoView.setMediaController(new MediaController(this)); 
65:	introVideoView.setOnPreparedListener(new MainPreparedListner()); 
-
67:	introVideoView.requestFocus(); 
68:	introVideoView.start(); 
-
74:	introVideoView.setVideoURI(defaultVideofile); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDuration, seekTo, setVideoURI
36:	VideoView view = new VideoView(getActivity()); 
-
39:	view.setVideoURI(Uri.fromFile(new File(filePath))); 
-
41:	int duration = view.getDuration(); 
42:	view.seekTo(duration); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnCompletionListener, setVideoPath
59:	v = new VideoView(c); 
60:	v.setOnCompletionListener(this); 
61:	v.setVideoPath(this.getResource() ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setZOrderOnTop, setMediaController, setOnCompletionListener
78:	_videoView = new VideoView(getActivity()); 
79:	_videoView.setZOrderOnTop(true); 
80:	_videoView.setMediaController(new MediaController(getActivity())); 
81:	_videoView.setOnCompletionListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath, start
20:	VideoView videoView = new VideoView(getApplicationContext()); 
-
22:	videoView.setVideoPath(getIntent().getStringExtra("path")); 
23:	videoView.setMediaController(new MediaController(this)); 
24:	videoView.requestFocus(); 
25:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnTouchListener, setOnCompletionListener, stopPlayback
88:	travel.stopPlayback(); 
-
90:	travel.setOnTouchListener(null); 
91:	travel.setOnCompletionListener(null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath
19:	VideoView v = new VideoView(this); 
-
22:	v.setVideoPath("/data/local/tmp/last_mohicans.3gp"); 
23:	v.setMediaController(new MediaController(this)); 
24:	v.requestFocus(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnTouchListener, setOnCompletionListener, setVideoURI, start
45:	final VideoView videoView = new VideoView(this); 
46:	setContentView(videoView); 
-
73:	videoView.setVideoURI(videoUri); 
74:	videoView.setOnCompletionListener(new OnCompletionListener() 
-
83:	videoView.setOnTouchListener(new OnTouchListener() 
-
96:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: requestFocus, setMediaController, setVideoPath, start
13:	VideoView videoView = new VideoView(this); 
-
16:	videoView.setVideoPath("http://javabog.dk/filer/hej_fra_Jacob.mp4"); 
-
19:	videoView.setMediaController(new MediaController(this)); 
20:	videoView.requestFocus(); 
21:	videoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMediaController, setOnErrorListener, setOnPreparedListener, setVideoURI
36:	player.setMediaController(controller); 
37:	player.setVideoURI(mediaPath); 
38:	player.setOnErrorListener(this); 
39:	player.setOnPreparedListener(this); 
Full Snippet Info
5
CodeRank
Related Android VideoView Questions & Answers:
Other Android VideoView Examples
12:	
13:		private ImageView imgPreview;
14:		private VideoView videoPreview;
15:		private Button btnCapturePicture, btnRecordVideo;
16:	
-
21:	
22:			imgPreview = (ImageView) findViewById(R.id.imgPreview);
23:			videoPreview = (VideoView) findViewById(R.id.videoPreview);
24:			btnCapturePicture = (Button) findViewById(R.id.btnCapturePicture);
25:			btnRecordVideo = (Button) findViewById(R.id.btnRecordVideo);

Read More

35:	
36:		private ImageView imgPreview;
37:		private VideoView videoPreview;
38:		private Button btnCapturePicture, btnRecordVideo;
39:	
-
44:	
45:			imgPreview = (ImageView) findViewById(R.id.imgPreview);
46:			videoPreview = (VideoView) findViewById(R.id.videoPreview);
47:			btnCapturePicture = (Button) findViewById(R.id.btnCapturePicture);
48:			btnRecordVideo = (Button) findViewById(R.id.btnRecordVideo);

Read More

See Code Examples for Android VideoView Methods: