I am working on video player application, I want to play .mp4 video in native videoview. I am not able to play
In Kotlin you can do as
val videoView = findViewById(R.id.videoView)
// If url is from raw
/* val url = "android.resource://" + packageName
.toString() + "/" + R.raw.video*/
// If url is from network
val url = "http://www.servername.com/projects/projectname/videos/1361439400.mp4"
val video =
Uri.parse(url)
videoView.setVideoURI(video)
videoView.setOnPreparedListener{
videoView.start()
}