How to add video playback and resource to android application

后端 未结 2 601
别跟我提以往
别跟我提以往 2021-02-05 23:56

I have got problem with my idea on andriod app. I\'d like to play video in it, but I don\'t want to download it from interenet. In other case, I want to have it on device.

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 00:25

    videoView = (VideoView) findViewById(R.id.videoview);
    
    videoview.setVideoPath("android.resource://" getPackageName() + "/" + R.raw.nameofvideofile);
    
    videoView.start();
    

提交回复
热议问题