小程序
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.
 

60 lines
921 B

Page({
data: {
videoSrc: '' // Replace with your video URL
},
onLoad(options) {
const s = decodeURIComponent(options.url);
console.log(s);
this.setData({
videoSrc:s
})
},
onReady() {
// Create video context
this.videoContext = wx.createVideoContext('myVideo');
},
// Play video
playVideo() {
this.videoContext.play();
},
onShareAppMessage() {
return {
title: 'OBD小程序',
path: '/pages/index/index'
};
},
// Pause video
pauseVideo() {
this.videoContext.pause();
},
// Event handlers
onVideoPlay() {
wx.showToast({
title: '视频开始播放',
icon: 'none'
});
},
onVideoPause() {
wx.showToast({
title: '视频已暂停',
icon: 'none'
});
},
onVideoEnded() {
wx.showToast({
title: '视频播放结束',
icon: 'none'
});
}
});