Giter Site home page Giter Site logo

scroll-video's Introduction

scroll-video

微信小程序视频上下滑动播放方案

视频滑动播放的两种方案:

  1. Swiper + Video ,使用Swiper嵌套Video进行视频播放, 小程序v2.4.0 起 Video组件支持同层渲染,大体思路是 保证一个视频组件, 记录Swiper的 current, 并且对 swiper-item的下标做比对,来对比当前index和current是否一致, 一致则展示Video组件。

    • 滑动效果比较好,还有优化的,怎么预加载, 怎么放置3个Video组件进行预加载的问题。
  2. 平移动画,模拟上下滚动的效果。大体思路是固定一个视频组件, 把封面图平铺在视频组件上,根据手势滑动的范围,确定上滑或者下滑,通过改变translateY,切换视频源播放。

    • 滑动效果不是很好,无法做到手指跟随。

Vide组件加载视频黑屏慢的可能解决方案

video组件在播放视频的时候会黑屏,或者loading时间长,这有几种方案仅供参考,排除网络问题。

相关链接参考

https://www.hansuku.com/archives/155

https://developers.weixin.qq.com/community/develop/doc/00086ae98f4a00b0338aa717e5b000?_at=1597887924129

https://developers.weixin.qq.com/community/develop/doc/0002c2279402f0c1f538a74215b800

scroll-video's People

Contributors

ismilesky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.