Troubleshooting video attachment transfer from Airtable to Microsoft Teams bot

I’m working on a Microsoft Teams bot using the Bot Framework SDK in Node.js. The bot retrieves data from Airtable and sends it to Teams. I’m using the VS Code Teams Toolkit for building and deploying the bot.

The issue I’m encountering is with sending video attachments from Airtable to the bot. I’ve tried several methods:

  1. Using the getInternetAttachment function, which resulted in an ‘Unknown attachment type’ error.
  2. Enabling supportsFile:true in manifest.json with no effect.
  3. Creating a video card that ended up with a ‘Malformed Video card - Invalid aspect value’ error.

Here’s an example of how I’m fetching attachments from Airtable:

const records = await base(course_tn).select({ view: 'Grid view' }).all();

records.forEach(async function(record) {
  const files = record.get('Attachments');
  const reply = { type: ActivityTypes.Message };
  reply.attachments = [await getInternetAttachment(files.url)];
  await turnContext.sendActivity(reply);
});

Everything runs well in the Bot Framework emulator. Does anyone know how to successfully send video attachments from Airtable to an MS Teams bot?

I encountered a similar issue when working with video attachments in Teams bots. One workaround I found effective was using adaptive cards with a media element. Here’s a basic implementation:

const card = CardFactory.adaptiveCard({
    type: 'AdaptiveCard',
    body: [{
        type: 'Media',
        poster: 'thumbnail_url',
        sources: [{ url: files.url }]
    }]
});

await turnContext.sendActivity({ attachments: [card] });

This approach allows for inline video playback within Teams. Make sure your Airtable URL is publicly accessible and the video format is supported by Teams (MP4 works best). If you’re still having issues, it might be worth checking your bot’s permissions in the Teams admin center.

have u tried using the videocard type from adaptivecards? it might work better for sending vids. also make sure ur airtable url is actually accessible and not private. could be a permissions issue. maybe try uploading the vid to a public hosting site first and use that url instead?

I’ve dealt with similar issues when integrating Airtable attachments into Teams bots. One approach that worked for me was using the Hero Card instead of trying to send the video directly. You can create a Hero Card with a thumbnail image from the video and a button that links to the full video URL. This way, users can click to view the video in their browser.

Here’s a rough example of how you might implement this:

const { CardFactory } = require('botbuilder');

// In your message handling function
const heroCard = CardFactory.heroCard(
    'Video Title',
    CardFactory.images(['thumbnail_url']),
    CardFactory.actions([
        {
            type: 'openUrl',
            title: 'Watch Video',
            value: files.url
        }
    ])
);

await turnContext.sendActivity({ attachments: [heroCard] });

This method bypasses Teams’ attachment limitations while still providing easy access to the video content. Just ensure your Airtable URLs are publicly accessible.