12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- // index.js
- // 获取应用实例
- const app = getApp()
- wx.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: '#ff0000',
- })
- const urls = [
- 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
- 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
- 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
- // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
- ]
- const videoList = urls.map((url, index) => ({
- id: index + 1,
- url,
- objectFit: 'cover'
- }))
- console.log('videoList', videoList)
- Page({
- data: {
- videoList,
- targetPlayIndex: -1
- },
-
- onLoad() {
- // setTimeout(() => {
- // this.setData({
- // targetPlayIndex: 6
- // })
- // console.log('指向播放')
- // }, 3000)
- },
- // 事件处理函数
- onPlay(e) {},
- onPause(e) {
- // console.log('pause', e.detail.activeId)
- },
- onEnded(e) {},
- onError(e) {},
- onWaiting(e) {},
- onTimeUpdate(e) {},
- onProgress(e) {},
- onLoadedMetaData(e) {
- // console.log('LoadedMetaData', e)
- },
- onChange(e) {
- // console.log('onChange', e.detail)
- }
- })
|