当我触摸视频时,我需要播放一段视频.当列表中的视频滚动时需要暂停



在我的应用程序中,我刚刚添加了RecyclerView,该列表包含多个视频。当我触摸视频时,我需要播放视频。视频滚动时需要暂停。

mVideoPlayer_1.addMediaPlayerListener(new SimpleMainThreadMediaPlayerListener(){
@Override
public void onVideoPreparedMainThread() {
// We hide the cover when video is prepared. Playback is about to start
mVideoCover.setVisibility(View.INVISIBLE);
}
@Override
public void onVideoStoppedMainThread() {
// We show the cover when video is stopped
mVideoCover.setVisibility(View.VISIBLE);
}
@Override
public void onVideoCompletionMainThread() {
// We show the cover when video is completed
mVideoCover.setVisibility(View.VISIBLE);
}
});
mVideoPlayerManager.playNewVideo(null, mVideoPlayer_1, "http:\url_to_you_video_1_source");

当当前播放的视频滚动时,我需要暂停它。

在RecyclerviewAdapter中使用onClickListener,在活动中使用onScrollListener

最新更新