Monday, April 8, 2013

[android help] Why does my video view wont work?


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

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...