-1
這是我的活動,它的工作。當mediacontroller隱藏時,Videoview如何顯示全屏?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_playing);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Intent intent = getIntent();
String link = intent.getStringExtra("link");
VideoView videoview = (VideoView) findViewById(R.id.videoView2);
MediaController mediacontroller = new MediaController(this);
mediacontroller.setAnchorView(videoview);
Log.i("Link",link);
Uri video = Uri.parse(link);
videoview.setMediaController(mediacontroller);
videoview.requestFocus();
videoview.setVideoURI(video);
videoview.start();
}
這是播放時屏幕:
但是當控制器皮,視頻畫面是不是全屏。
mediacontroller隱藏時,Videoview如何顯示全屏?