Course Content

Course Content

Creating Video Player In Andorid

Create Video Player in Android

 

In this video we are going to create a Video player in Android.

Firstly we will store one video which we want to use in our SD Card.

Now we will provide certain permissions to our 'AndroidManifest.xml' files,

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

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

Now in our class 'videoplayer' we will code the following,

VideoView v;

String srcpath;

@Override

public void onCreate(Bundle savedInstanceState)

{

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

srcpath="/sdcard/FILENAME";

v=VideoView(findViewById(R.id.videoView1));

v.setVideoPath(srcpath);

v.setMediaController(new MediaController(this));

v.start();

v.requestFocus();

}

Now we will execute our code, and as soon as we execute it, our video starts to play and runs successfully.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
App Store
397K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
13K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere