Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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();
 
PREVIOUS NEXT
Tagged: #android #videoview #setup
ADD COMMENT
Topic
Name
1+4 =