I've research so many codes and yet my simple 3gpp video wo'nt play or work in the emulator when i clicked the button.
My question is why does my video view wont run? In log cat it shows many errors in AndroiRuntime.
Heres my manifest :
android:name=".TutorialFive"
android:label="@string/app_name"
>
Heres the xml :
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >android:id="@+id/video1"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
Heres the java code:
VideoView vid = (VideoView) findViewById(R.id.bThree);
// to set the path of the video
String urlpath = "android.resource://" + getPackageName() + "/"
+ R.raw.xai;
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(vid);
vid.setMediaController(mediaController);
vid.setVideoURI(Uri.parse(urlpath));
vid.start();
.
stackoverflow.comm
No comments:
Post a Comment