| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | videoContext:null, |
| | | category: [], |
| | | tagCodes: '', |
| | | videoUrl: '', |
| | | showVideo: false, |
| | | |
| | | isShow:false, |
| | | curVideoSrc:'', |
| | | dataList: [], |
| | | total: 0, |
| | | pageSize: 10, |
| | |
| | | }, |
| | | itemClick(e) { |
| | | const { videourl } = e.currentTarget.dataset |
| | | wx.previewMedia({ |
| | | sources: [{ url: videourl, type: 'video' }] |
| | | }) |
| | | this.startPlayVideo(videourl) |
| | | |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: videourl, type: 'video' }] |
| | | // }) |
| | | }, |
| | | cateClick(e) { |
| | | const { code } = e.target.dataset |
| | |
| | | onLoad(options) { |
| | | this.getTagList() |
| | | this.getList() |
| | | this.videoContext = wx.createVideoContext('myVideo') |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | startPlayVideo(videourl){ |
| | | this.setData({isShow:true, curVideoSrc:videourl}) |
| | | console.log(videourl) |
| | | this.videoContext.requestFullScreen({ |
| | | // direction: 0 |
| | | }); |
| | | }, |
| | | onClose(){ |
| | | this.setData({isShow:false}) |
| | | if(this.videoContext){ |
| | | this.videoContext.exitFullScreen() |
| | | } |
| | | } |
| | | }) |