0
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;

enter image description here

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
Karthikeyan Vaithilingam
  • 6,473
  • 10
  • 41
  • 60
ann
  • 1
  • did you try this solution? https://stackoverflow.com/questions/33005617/android-cant-play-this-video-mediaplayer-videoview-error-1-38 – jose Apr 01 '20 at 07:12
  • yes i have still does not work, but i have fixed it now, just used a phone with a more better API. – ann Apr 07 '20 at 18:16
  • i just updated my `targetSdkVersion` to `30` because of `Scoped Storage` and suddenly same error started occurring – Vivek Thummar May 01 '21 at 06:57

0 Answers0