微信小程序中,点击视频,没有跳转播放,可能是因为没有在app.json中正确注册视频播放页面的路径
const customMethodMap = {
handlePreview(e) {
const { item: { url } } = e?.currentTarget?.dataset
console.log('Clicked item URL:', url); // 输出URL
const type = url.split('.')[url.split('.')?.length - 1]
console.log('File type:', type); // 输出文件类型
console.log(isDoc(type))
isPic(type) && (() => {
openPic(url)
})()
isDoc(type) && (() => {
openDoc(url)
})()
isVideo(type) && (() => {
console.log('Navigating to video player'); // 输出导航信息
// openVideo(url)
wx.navigateTo({ url: `/pages/resource/components/video-play/index?url=${url}` })
})()
}
}
Clicked item URL: 56/product/旭包鲜食品包装用微波炉保鲜膜视频_549867.mp4
File type: mp4
false
Navigating to video player
/pages/resource/components/video-play/index?url=${url}
{
"pages": [
"pages/index/index",
"pages/resource/components/video-play/index"
]
}