Skip to main content

Posts

Showing posts with the label play video example

Program to play video in android

Play video in android, play video from sdcard  In this example,i'll show you to play video from sdcard  Create object of videoView in your activity VideoView obj=(VideoView)findViewId(R.id.videoView1); Set path of file Obj.setVideoPath(“sdcard/path of file.3gp”); Now call Obj.setMediaController(new MediaController); main.xml <? xml version = "1.0" encoding = "utf-8" ?> < LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android"     android:orientation = "vertical"     android:layout_width = "fill_parent"     android:layout_height = "fill_parent"     > < TextView       android:layout_width = "fill_parent"     android:layout_height = "wrap_content"     android:text = "@string/hello"     /> < VideoView android:layout_height = "wrap_content" android:id = "@+id/videoView1" android:layout_width = "match_parent" > <