Android本来也是闲着无聊自己自学的,做了几个小的demo,今天又在网上扒拉一堆,做了一个播放视频的demo
代码都很简单,大家可以举一反三啊
package com.zking.administrator.g160628_android28_playvideo;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.view.SurfaceView;
import android.view.View;
import android.widget.ImageButton;
import android.widget.SeekBar;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
private MediaPlayer mediaPlayer;
private SeekBar sb_main_bar;
private SurfaceView sv_main_surface;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sb_main_bar = (SeekBar) findViewById(R.id.sb_m