// 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) } })