PDA

View Full Version : Problem with playing Video file.



John_Yard
10-16-2009, 05:08 AM
Hi All,

I am just trying to play a video from a raw folder available in my project resource by using the following simple code snippet provided by Android developers website.

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sample); // sample: it is a .m4v file.
mp.start();

}

But when i run my code, it plays only the sound, i didn't see video player or video. Only sound is coming. May i know what should be the problem and how to resolve this issue?

Note: I'm trying on Android OS 1.5 HTC T-mobile handset.

Can someone came across this please provide me your suggestions?

John..

maclondon
02-07-2010, 04:59 AM
i havent had that issue - but check the video codec is supported.

the .extenstion isnt necessarily an indicator or the video/audio codecs

you may need to convert it to what ever the media player wants, specifically.

check the documentation, make sure your video matches exactly