index.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // index.js
  2. // 获取应用实例
  3. const app = getApp()
  4. wx.setNavigationBarColor({
  5. frontColor: '#ffffff',
  6. backgroundColor: '#ff0000',
  7. })
  8. const urls = [
  9. 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  10. 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  11. 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
  12. 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
  13. 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
  14. // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  15. // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  16. // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
  17. // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
  18. // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
  19. // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  20. // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  21. // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
  22. // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
  23. // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
  24. // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  25. // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  26. // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
  27. // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
  28. // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
  29. // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  30. // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  31. // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
  32. // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
  33. // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
  34. // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
  35. // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
  36. ]
  37. const videoList = urls.map((url, index) => ({
  38. id: index + 1,
  39. url,
  40. objectFit: 'cover'
  41. }))
  42. console.log('videoList', videoList)
  43. Page({
  44. data: {
  45. videoList,
  46. targetPlayIndex: -1
  47. },
  48. onLoad() {
  49. // setTimeout(() => {
  50. // this.setData({
  51. // targetPlayIndex: 6
  52. // })
  53. // console.log('指向播放')
  54. // }, 3000)
  55. },
  56. // 事件处理函数
  57. onPlay(e) {},
  58. onPause(e) {
  59. // console.log('pause', e.detail.activeId)
  60. },
  61. onEnded(e) {},
  62. onError(e) {},
  63. onWaiting(e) {},
  64. onTimeUpdate(e) {},
  65. onProgress(e) {},
  66. onLoadedMetaData(e) {
  67. // console.log('LoadedMetaData', e)
  68. },
  69. onChange(e) {
  70. // console.log('onChange', e.detail)
  71. }
  72. })