Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to make VideoView keep playing in background on Android app?

I'm currently using VideoView to play video from URL (Streaming..), when i press home the video stops..

is there a way to make it keep playing?

Whats the best way to make a video keep running in background?

Thanks in advance, Amitos80

like image 835
amitos80 Avatar asked Nov 06 '11 20:11

amitos80


1 Answers

You should use MediaPlayer instead of VideoView.

m = new MediaPlayer();
m.setDatasource(url);
m.prepare();
m.start();
like image 133
Cedric Fung Avatar answered Nov 09 '22 02:11

Cedric Fung