• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps A very simple video question

XJimmyPageX

Lurker
Apr 17, 2010
1
0
Hi, im very new to eclipse and and android, im trying to do the following simple thing -
i wanna play a video.
ive copied the video - sample.3gp file into Raw/sample.3gp , used the layout and dragged a VideoView, other than that i think my code is enough to understand -

package video.hello;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.widget.VideoView;

public class HelloVideo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

VideoView theView = new VideoView(getApplicationContext());
theView.setId(R.id.theView);
MediaPlayer mp = new MediaPlayer();
mp = MediaPlayer.create(theView.getContext(),R.raw.samp le );
mp.start();

}
}


I get sound but no video, the screen is plain black.
Obviously im getting something totaly wrong, give me a hand here please
wink5.gif


Thanks!!
Roei
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones