int width = this.getWindowManager().getDefaultDisplay().getWidth();
int height = this.getWindowManager().getDefaultDisplay().getHeight();
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/"
+ R.raw.qidongfirst);
tiaoguo = (Button) findViewById(R.id.tiaoguo);
videoView = (VideoView) findViewById(R.id.video);
if (videoView != null ) {
ViewGroup.LayoutParams lp = videoView.getLayoutParams();
lp.width = width;
lp.height = height;
videoView.setLayoutParams(lp);
videoView.setVideoURI(uri);
videoView.start();}
安卓 利用videoView 播放资源文件 并且全屏播放 适用于闪屏页
最新推荐文章于 2021-05-27 08:19:54 发布