Android: not able to play video using videoview

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

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


i have trying to add VideoView in RecyclerView

Updated August 18, 2018 10:26 AM


Play Video in Android Studio

Updated April 21, 2018 20:26 PM