^

Play a Local Video File

Article 44 in Android-Java

2020-09-02 06:45:29 from bugfish
Play a Local Video File
Android-Java / File Operations
Last Review on: 2021-10-26 18:05:24 | Hits: 303

Here the code to display a video in a videoView element.

VideoView videoview         =  findViewById(R.id.VIDEOVIEWID);
Uri uri = Uri.parse(STRING PATH TO FILE);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoview);

videoview.setMediaController(mediaController);
videoview.setVideoURI(uri);
videoview.start();
I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
Currently 2 Upvotes!
captcha image
System - 2021-01-05 20:15:42
We appreciate comments on our site!

Theme
11/11
This Website is using Session Cookies for Site Functionality and AWStats.