You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
631 B
30 lines
631 B
|
6 months ago
|
Page({
|
||
|
|
data: {
|
||
|
|
videoUrl: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241214185_1.mp4',
|
||
|
|
},
|
||
|
|
videoContext: null as WechatMiniprogram.VideoContext | null,
|
||
|
|
onLoad() {
|
||
|
|
this.videoContext = wx.createVideoContext('video')
|
||
|
|
},
|
||
|
|
onUnload() {
|
||
|
|
if (this.videoContext) {
|
||
|
|
this.videoContext.stop()
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleVideo() {
|
||
|
|
if (this.videoContext) {
|
||
|
|
this.videoContext.play()
|
||
|
|
this.videoContext.requestFullScreen({
|
||
|
|
direction: 0,
|
||
|
|
})
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleFullScreen(e) {
|
||
|
|
if (!e.detail.fullScreen && this.videoContext) {
|
||
|
|
this.videoContext.stop()
|
||
|
|
}
|
||
|
|
},
|
||
|
|
})
|
||
|
|
|
||
|
|
export {}
|