waynell / videolistplayer Goto Github PK
View Code? Open in Web Editor NEWPlay video in ListView or RecyclerView
License: MIT License
Play video in ListView or RecyclerView
License: MIT License
我正在使用翻译工具我只会说英语..我看到你的图书馆我很好奇,它支持动态VideoView,我需要设置高度作为包装,感谢提前
FATAL EXCEPTION: main
Process: com.gocktrip, PID: 12504
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.waynell.videolist.visibility.items.ListItemData.getIndex(ListItemData.java:17)
at com.waynell.videolist.visibility.calculator.SingleListViewItemActiveCalculator.findPreviousItem(SingleListViewItemActiveCalculator.java:132)
at com.waynell.videolist.visibility.calculator.SingleListViewItemActiveCalculator.calculateActiveItem(SingleListViewItemActiveCalculator.java:301)
at com.waynell.videolist.visibility.calculator.SingleListViewItemActiveCalculator.onStateTouchScroll(SingleListViewItemActiveCalculator.java:75)
at com.waynell.videolist.visibility.calculator.BaseItemsVisibilityCalculator.onScrolled(BaseItemsVisibilityCalculator.java:43)
at com.gocktrip.videolist.VideoList$1.onScrolled(VideoList.java:129)
我这边装制作.9图的环境始终装不上,现在需要一个没有tablayout的.9背景图额,能不能那个项目也传上来额?或者能不能把那个没有tablayout的.9 图发给我额,谢谢啦。。。
非常实用的项目,感谢!目前我是在VideoViewHolder的onBind处判断当前网络是否WIFI环境来加载视频,并修改了点击事件,如果能增加一个开关方法就更好了。还有就是目前在我的项目中是跳转到自己的一个全屏播放页,如果跳转时能记录播放状态并暂停、返回时能跳转进度并继续播放就更完美了。
当使用RecycleView的时候,ItemsProvider接口的实现是:
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(position);
if (holder instanceof ListItem) {
return (ListItem) holder;
}
可是在ListView中呢? 使用 listView.getChildAt(position).getTag(),然后强制类型转换。但这时候的到的viewHolder是复用的,滑动时候很多videoView无法展示。
java.lang.IndexOutOfBoundsException: Invalid index 5, size is 5
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.topToBottomMostVisibleItem(SingleListViewItemActiveCalculator.java:206)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.calculateMostVisibleItem(SingleListViewItemActiveCalculator.java:179)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.onScrollStateIdle(SingleListViewItemActiveCalculator.java:159)
Hi!
How are u?
How can i pause de video when i press home button?
I have other question too.. i have to scroll down a little for first video load.. how can i fix?
thanks!
设置为wrap_content之后,视频不播放
Many thanks for great work. can I display youtube videos ?
第一次加载视频的时候,尽管网络状况很好,加载速度还是比较慢 。和用videoview 在 list 里面 直接加载相比,速度慢很多。
是否考虑增加对 StaggeredGridLayoutManager 的适配?
尝试自己写了一下,感觉不太理想。
快速上滑下滑,大概就是视频item高度的距离(使视频item不显示在屏幕中,最后还是回到视频item的位置),视频会停止播放
当屏幕里连续两个item都是视频类型的item时,上面的item会同时闪动这两个item的视频中的帧,只在API LEVEL19的机型上有这个问题,初步怀疑是open GL的bug,不知道作者有碰到么?
textureVideoView.setScaleType(ScalableTextureView.ScaleType.CENTER_CROP);
原视频是长方形,要裁剪成正方形,最后发现变形。
控制视频的播放/暂停/进度条,还有全屏欣赏
FATAL EXCEPTION: main
Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
com.waynell.videolist.visibility.calculator.SingleListViewItemActiveCalculator.findPreviousItem(SingleListViewItemActiveCalculator.java:132)
SingleListViewItemActiveCalculator.calculateActiveItem(SingleListViewItemActiveCalculator.java:301) SingleListViewItemActiveCalculator.onStateTouchScroll(SingleListViewItemActiveCalculator.java:75) BaseItemsVisibilityCalculator.onScrolled(BaseItemsVisibilityCalculator.java:43)
@waynell Hey i want to play video in play button not scroll view in my project.i am using your library in my project ,library is working fine 👍 , but now video play in play button & want pause button and video time.
Please help me its urgent
现在是缓存完之后才开始播放,请问怎么样才能实现一边缓存一变播放?
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference at com.volokh.danylo.visibility_utils.items.ListItemData.getIndex(ListItemData.java:22) at com.volokh.danylo.visibility_utils.items.ListItemData.getVisibilityPercents(ListItemData.java:42) at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.calculateActiveItem(SingleListViewItemActiveCalculator.java:309) at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.onStateTouchScroll(SingleListViewItemActiveCalculator.java:76)
When I am trying to scroll it is giving the NullPointerException.I didn't find any way to setCurrentItem in SingleListViewItemActiveCalculator
@waynell Hey i don't know why but some url is not working in recycler view(mp4 extension) .
Url upload from iphone device but url extension mp4 .
Because the function openVideo and release video working not sync, and reuse item on Listview. Somtime if you scroll listview up and down fast and many time, mMediaplayer have null value => NullPointerException.
删除之后 notifyDataSetChanged 没有 机会 setActive
Can you please change the code as per new glide v4 version because of some methods not found like using() or etc.
怎么通过 glide 判断url 的视频是否下载过了
视频在没有开始加载的时候 能否获取第一帧占位图
你好,当recyclerview一个item播放视频时,此时滑动recyclerview,小bug是当video item符合deactive条件,并且recyclerview处于idle状态才会deactive 这个video item。不会在video item符合deactive条件,并且处于滑动状态deactive这个video item。
第二个问题是,缺少mediaplayer状态管理机制,我自己简单的实现了一下,activity/fragment生命周期与texturevideoview的mediaplayer关联起来,这样,当video item播放视频时,启动一个activity,此时video item 的mediaplayer会随着新activity的启动销毁,返回时,video item 无法播放视频。希望,我再完善一下可以pull request。
第一个问题,我还在研究,希望可以共同研究一下。
水平有限,有不对的地方,请多指教。
@OverRide
public void videoBeginning() {
mVideoView.setVisibility(View.VISIBLE);
mPlaybackImage.setVisibility(View.INVISIBLE);
cancelAlphaAnimate(mVideoCoverImage);
startAlphaAnimate(mVideoCoverImage);
}
@Override
public void videoStopped() {
cancelAlphaAnimate(mVideoCoverImage);
mVideoView.setVisibility(View.INVISIBLE);
mPlaybackImage.setVisibility(View.VISIBLE);
mVideoCoverImage.setAlpha(1.f);
mVideoCoverImage.setVisibility(View.VISIBLE);
}
@OverRide
public void setActive(View newActiveView, int newActiveViewPosition) {
videoState = STATE_ACTIVED;
if (videoLocalPath != null && NetUtil.getNetworkStatus(mContext) == NetUtil.NETWORN_WIFI) {
mVideoView.setVideoPath(videoLocalPath);
mVideoView.start();
}
}
为什么VideoView设置过不可见之后,即便开始setActive(start之后难道不会调用videoBeginning),也看不到VideoView,依旧看到封面
Hi, I use this library load video but after download video not play (only android 4.1.2). This is log:
E/MediaPlayer: Uri is
W/QComExtractorFactory: Didn't match the sniff <=== status = 5
W/QComExtractorFactory: Not matched with any sniff above, lets try other sniffs
W/QComExtractorFactory: Not matched with any sniff above, lets try other sniffs
W/QComExtractorFactory: Didn't match the sniff <=== status = 1
W/QComExtractorFactory: Didn't match the sniff <=== status = 1
W/QComExtractorFactory: Didn't match the sniff <=== status = 1
重新激活item时,该item都是都是重新播放的,那么如何设置从上次观看位置继续播放?
When my recyclerview list contains only video view that time first and the last video is not played. It's starting to play from the second or sometimes start to play the third video which is not visible in the view. Can you please give me any perfect solution for that.
It's really urgent.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.