仿京东淘宝商品详情页中视频和图⽚的轮播功能
还没有学会如何上传视频到博客上,先上传图⽚吧洛克人x8图文攻略
案例下载地址:
视频播放借⽤了饺⼦播放器,最主要的就是适配器⾥的代码书写:
@Override
public Object instantiateItem(ViewGroup container, final int position) {
安全带扣分String url = (position % imgUrls.size());
if (!ains(".mp4")) {
ImageView imageView = new ImageView(mContext);
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
// imageView.setScaleType(ImageView.ScaleType.FIT_XY);
Glide.with(mContext).load(url).into(imageView);
container.addView(imageView);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// bannerListener.bannerClick(position % imgUrls.size());
}
});美术设计
return imageView;
江南歌词
} else {
// final VideoView videoView = new VideoView(mContext);
// Uri uri = Uri.parse(url);
// videoView.setVideoURI(uri);
// videoView.start();
JZVideoPlayerStandard jzVideoPlayerStandard = new JZVideoPlayerStandard(mContext);
jzVideoPlayerStandard.setUp(url, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "播放测试");
// Glide.with(this).load("jzvd-pic.nathen/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(myJZVideoPlayerStandard.thumbImageView); Glide.with(mContext).(1)).into(jzVideoPlayerStandard.thumbImageView);
JZVideoPlayer.setJzUserAction(null);
container.addView(jzVideoPlayerStandard);
// videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
// @Override
// public void onCompletion(MediaPlayer mp) {
bannerListener.playEnd();
// }
// });
return jzVideoPlayerStandard;
}
}
桂林旅游景点图片>林正英僵尸大全电影// public void setBannerListener(BannerListener bannerListener) {
/
/ this.bannerListener = bannerListener;
// }
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论