我的布局是這樣的
所以視頻播放器是固定大小的 當然是有屏幕適配的
<cn.jzvd.JZVideoPlayerStandard
android:scaleType="fitXY" android:layout_above="@+id/btn_luyin" android:layout_marginBottom="6dp" android:layout_centerHorizontal="true" android:id="@+id/jiecao_video" android:layout_width="321.55dp" android:layout_height="169.45dp" ></cn.jzvd.JZVideoPlayerStandard>
jiecao_video.setUp(alist.get(0).getVideo_url(), JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "");
jiecao_video.SAVE_PROGRESS = false;
jiecao_video.TOOL_BAR_EXIST = false;
jiecao_video.thumbImageView.setScaleType(ImageView.ScaleType.FIT_XY);
//下邊這個是視頻的縮略圖地址
// Glide.with(getApplicationContext()).load(圖片地址)
// .into(videoplayer.thumbImageView);
JZVideoPlayer.setVideoImageDisplayType(JZVideoPlayer.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT);
@Override
protected void onDestroy() {
super.onDestroy();
if (jiecao_video != null)
jiecao_video.releaseAllVideos();
}
@Override
protected void onPause() {
super.onPause();
JZVideoPlayer.releaseAllVideos();
}