index.wxml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <view class="container">
  2. <swiper
  3. class="video-swiper"
  4. circular="{{circular}}"
  5. easing-function="{{easingFunction}}"
  6. vertical
  7. current="1"
  8. duration="{{duration}}"
  9. bindanimationfinish="animationfinish">
  10. <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
  11. <swiper-item wx:for="{{curQueue}}" wx:key="*this">
  12. <video
  13. id="video_{{index}}"
  14. class="video_item"
  15. loop="{{loop}}"
  16. enable-play-gesture
  17. enable-progress-gesture
  18. show-center-play-btn="{{false}}"
  19. controls="{{false}}"
  20. src="{{item.url}}"
  21. data-id="{{item.id}}"
  22. object-fit="{{item.objectFit || 'cover'}}"
  23. data-index="{{index}}"
  24. bindplay="onPlay"
  25. bindpause="onPause"
  26. bindended="onEnded"
  27. binderror="onError"
  28. bindtimeupdate="onTimeUpdate"
  29. bindwaiting="onWaiting"
  30. bindprogress="onProgress"
  31. bindloadedmetadata="onLoadedMetaData"
  32. >
  33. </video>
  34. </swiper-item>
  35. </swiper>
  36. </view>