javascriptwhatsappsmooch

Previewing Smooch videos in Whatsapp


I am sending videos from my Smooch account to users. This is the relevant part of the code I'm using for testing:

var stream = fs.createReadStream('./video.mp4')

              smooch.attachments.create({
                  appId: appId,
                  props: {
                      for: 'message',
                      access: 'public',
                      appUserId: appUserId
                  },
                  source: stream
              })
              .then((response) => {
                      smooch.appUsers.sendMessage({
                          appId: appId,
                          userId: appUserId,
                          message:{
                              role: 'appMaker',
                              type: 'image',
                              mediaUrl: response.mediaUrl
                          }
                      })
                  })

When the user receives the file, they get a download link to get the file. However, for other file formats, such as pdf, Whatsapp shows a preview.

Is it possible to get Whatsapp to show the video preview and watch the video directly from the app? I have tried different video formats but the result is always the same.

Thank you!


Solution

  • This is the correct way to upload and send videos.

    Displaying videos with previews in WhatsApp is a current feature gap that we plan to address.