Android: not able to play video using videoview

by jitsm555   Last Updated October 20, 2019 05:26 AM

Please find below xml

<VideoView
        android:id="@+id/video_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
    />

Java Code:

  String url = "android.resource://com.example.androidtutorial/" + R.raw.instructions;
  videoView.setVideoURI(Uri.parse(url));
  videoView.start();

Error is shown in Logcat:

2019-10-20 10:51:16.708 5063-5063/? E/androidtutoria: Unknown bits set in runtime_flags: 0x8000
2019-10-20 10:51:22.825 5063-5080/com.example.androidtutorial E/MediaPlayerNative: error (1, -2147483648)
2019-10-20 10:51:23.178 5063-5063/com.example.androidtutorial E/MediaPlayer: Error (1,-2147483648)

I saw many samples on the internet that uses the same code, but in my case, it is not working.



Related Questions


Updated August 18, 2018 10:26 AM

Updated June 17, 2017 11:26 AM

Updated April 21, 2018 20:26 PM

Updated July 17, 2019 05:26 AM

Updated July 10, 2018 05:26 AM