Skip to content

HalyangDream/ShortVideo

Repository files navigation

模仿抖音上下滑动的Demo

1.0.0(2023.4.14)

1.上下滑动视频
2.滑动完成后自动播放当前视频,自动停止上一个视频
3.若要运行成功,需要在MainActivity中的bindData()中添加视频链接

 private void bindData() {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add("");
        }
        adapter.addData(list);

        recyclerView.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (recyclerView.getScrollState() == RecyclerView.SCROLL_STATE_IDLE) {
                    autoStopPreVideo();
                    autoPlayCurrentVideo();
                }
            }
        }, 300);
    }

About

模仿抖音短视频的上下滑动视频

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages