VideoPlayerPopup.js
585 Bytes
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
Component({
properties: {
show: {
type: Boolean,
value: false,
},
videoUrl: {
type: String,
value: '',
},
},
data: {},
methods: {
onClose() {
this.setData({
show: false,
});
this.triggerEvent('close');
},
preventMove() {
// 阻止滚动穿透
return false;
},
onPlay() {
// 视频开始播放
},
onError(e) {
console.error('视频播放错误:', e);
wx.showToast({
title: '视频播放失败',
icon: 'none',
});
},
},
});