Answers for "android videoview example"

1

android videoview setup

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.your layout xml file);
        VideoView videoView = findViewById(R.id.your videoview id);
        String videoPath = "android.resource://" + getPackageName() + "/" + R.raw.your video's name;
        Uri uri = Uri.parse(videoPath);
        videoView.setVideoURI(uri);
        videoView.start();
Posted by: Guest on June-07-2021
-1

android video view

VideoView myVideo = (VideoView) findViewById(R.id.GifVideoView);
myVideo.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.dog_video));
myVideo.start();
Posted by: Guest on January-28-2021

Browse Popular Code Answers by Language