package com.example.admin.myapplication;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class MainActivity extends AppCompatActivity {
private VideoView video;
MediaController mediaController;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
video= (VideoView) findViewById(R.id.videoView);
mediaController = new MediaController(this);
String path= Environment.getExternalStorageDirectory().getAbsolutePath()
+"/Free Loop";
video.setVideoPath(path);
video.setMediaController(mediaController);
mediaController.setMediaPlayer(video);
}
}
目前暂无任何回答
- 0 回答
- 0 关注
- 2250 浏览
添加回答
举报
0/150
提交
取消