Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MultiThreading, AsyncTask and UI thread

I am developing an app in which I am playing multiple videos at a time. Also performing some operations at same time.

Now I am successful in running 2 videos at a time using VideoView by having reference from here and here.

Both options are working fine for me. But my question is, is it safe to play 2 videos at a time on UI thread or shall I go with option creating threads and playing them separately or shall I use AsyncTask or is it safe to use UI thread directly?? And please tell me the difference of using all 3 approaches.

like image 844
Rohit Avatar asked Feb 19 '26 12:02

Rohit


1 Answers

when you play a video it does decoding, buffering in background. It doesn't do this work on UI thread. You probably only need to call start() function on UI thread.

like image 180
Sarfraz Avatar answered Feb 22 '26 00:02

Sarfraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!