Playing a video in android

后端 未结 1 749
后悔当初
后悔当初 2020-12-20 00:51

Im implementing a video playback in android im completely new to android, and this is the bit of code i have gathered so far.

according to the logic it should play a

相关标签:
1条回答
  • 2020-12-20 01:13
    <VideoView
      android:id="@+id/videoView1"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
       />
    
    
    VideoView vv = (VideoView) findViewById(R.id.videoView1);
    uri = "your video uri";
    vv.setVideoURI(Uri.parse(uri));
    vv.start();
    
    vv.setOnCompletionListener(new OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mp) {
               finish();
      }
    });
    
    0 讨论(0)
提交回复
热议问题