Because the applet calls onShareAppMessage When ,imageUrl Parameters can only be in picture format , If it is mp4 If you don't, you won't be able to show the shared picture , What to do at this time ?
You can use alicloud oss The way of video frame cutting , Capture a frame of the video as a picture and pass it in and , You can show !
Here's how
onShareAppMessage: function (ops) {
if (ops.from === 'button') {
// From the forward button inside the page
console.log(ops.target)
}
let path = route .split('.')[ route .split('.').length - 1] == "mp4" ? route + "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast" : The original path
return {
title: 11223344,
path: Project path ,
imageUrl: path
}
}
stay mp4 Put it on the back ?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast" that will do
There are more solutions
Refer to the link below
https://help.aliyun.com/document_detail/64555.html?spm=a2c4g.11186623.6.1408.3f1017f1DL079V&tdsourcetag=s_pcqq_aiomsg