当前位置:网站首页>The applet calls the native onshareappmessage to share. What if the imageurl parameter is in MP4 format

The applet calls the native onshareappmessage to share. What if the imageurl parameter is in MP4 format

2020-11-09 16:56:03 Code industry Sibo

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

版权声明
本文为[Code industry Sibo]所创,转载请带上原文链接,感谢