How to play a video on videoView by a link address in android -


i have code:

string srcpath = "http://blog.mehdirahimi.ir/wp-content/uploads/egg_heart.mp4"; videoview myvideoview = (videoview)findviewbyid(r.id.videoview1); myvideoview.setvideouri(uri.parse(srcpath)); myvideoview.setmediacontroller(new mediacontroller(this)); myvideoview.requestfocus(); myvideoview.start(); 

and want play video link address stored in database, have problem code getting "can't play video"

i found answer, problem dont add internet permission android application.

for solve problem add cod manifest.xml file

 <uses-permission android:name="android.permission.internet" /> 

use in manifest.xml follow this:

<uses-sdk     android:minsdkversion="8"     android:targetsdkversion="18" />  <uses-permission android:name="android.permission.internet" /> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -