I have 4 .mp4 videos that I need to play in an android app. I managed to play 1 video, but the other 3 won't play. I think video size is the issue. The video that I managed to play has a size of 1.4mb and the other 3 have a size of 6mb, 2.2mb, 3.8mb.
Here's my code for playing them.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_videoviewer);
Bundle extras = getIntent().getExtras();
if (extras != null) {
String value = extras.getString("VidName");
if(value.equals("MinorBurnVid"))
{
try
{
videoView1 = (VideoView)findViewById(R.id.Video1);
videoView1.setVideoPath("android.resource://dr.droid/" + R.raw.burn);
videoView1.setMediaController(new MediaController(this));
videoView1.requestFocus();
videoView1.start();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
else if(value.equals("ChokingAdultVid"))
{
try
{
videoView1 = (VideoView)findViewById(R.id.Video1);
videoView1.setVideoPath("android.resource://dr.droid/" + R.raw.chokingadult);
videoView1.setMediaController(new MediaController(this));
videoView1.requestFocus();
videoView1.start();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
else if(value.equals("CPRAdultVid"))
{
try
{
videoView1 = (VideoView)findViewById(R.id.Video1);
videoView1.setVideoPath("android.resource://dr.droid/" + R.raw.cpr);
videoView1.setMediaController(new MediaController(this));
videoView1.requestFocus();
videoView1.start();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
else if(value.equals("Fracture"))
{
try
{
videoView1 = (VideoView)findViewById(R.id.Video1);
videoView1.setVideoPath("android.resource://dr.droid/" + R.raw.fracture);
videoView1.setMediaController(new MediaController(this));
videoView1.requestFocus();
videoView1.start();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
}
}
The burn video is the one that I managed to play but the other 3, no luck! Any ideas?