protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView videoView = findViewById(R.id.videoView2);
//String path = "android.resource://" + getPackageName() + "/" + R.raw.video123;
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video12);
videoView.setMediaController(new MediaController(this));
videoView.setVideoURI(uri);
videoView.start();
}
I am trying to play a simple video when running the android emulator but it is not allowing me and says "can't play this video".
This is the error i get;
D/MediaPlayer: getMetadata
E/MediaPlayer: error (1, -38)
E/MediaPlayer: error (1, -38)
E/MediaPlayer: Error (1,-38)
D/VideoView: Error: 1,-38
E/MediaPlayer: Error (1,-38)
D/VideoView: Error: 1,-38