lrj
10 小时以前 29fc6f5b1981775be5d2f0f9f8e61fec2f550252
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Page({
  data: {
    videoUrl: '',
    title: '',
    showControls: true
  },
 
  onLoad(options) {
    const { url, title } = options
    this.setData({
      videoUrl: decodeURIComponent(url || ''),
      title: decodeURIComponent(title || '视频播放')
    })
    
    // 设置导航栏标题
    wx.setNavigationBarTitle({
      title: this.data.title
    })
  },
 
  onVideoError(e) {
    console.error('视频播放错误:', e.detail)
    wx.showToast({
      title: '视频播放失败',
      icon: 'none'
    })
  },
 
  onVideoPlay() {
    console.log('视频开始播放')
  },
 
  onVideoPause() {
    console.log('视频暂停')
  },
 
  onVideoEnded() {
    console.log('视频播放结束')
  }
})