Botkit: Messenger video not loading ...

Created on 18 Oct 2016  ยท  12Comments  ยท  Source: howdyai/botkit

Hello,

Any idea why the below code isn't loading the video? It displays the typing indicator for few seconds and then nothing happens.

          controller.hears('music', 'message_received', function(bot, message) {
        var musicAttachment = {
          'type':'video',
          'payload':{
              'url':'https://www.youtube.com/watch?v=YQHsXMglC9A'
            }
        };

        bot.reply(message,{attachment:musicAttachment});
    });

I was following the below doc for the video attachment syntax -
https://developers.facebook.com/docs/messenger-platform/send-api-reference/video-attachment

Thanks!

Facebook-related help wanted

All 12 comments

Have you managed to resolve this?

Can you try:

bot.reply(message, {
    attachment:{
        'type':'video',
        'payload':{
            'url':'https://www.youtube.com/watch?v=YQHsXMglC9A'
        }
    }
});

Also what version of Botkit are you using? , can you make sure you have updated to the latest one, also make sure you have setup your webhooks properly in Facebook

Hi alexbudin, this is still an issue. I tried on a new messenger bot with the latest botkit and the video doesn't load. I tried your code as well, but no luck. Is there a specific webhook that we need to setup on Facebook side to reply with a video attachment? I tried image and it's loading correctly.

Hey @ajith007 and @alexbudin, I have been able to load and play video successfully on Messenger, BUT, as per those docs: "URL of video binary", which means it won't load a stream from youtube for instance. I had to download the youtube videos, convert them to .mp4 and host them myself. Also, be aware, large videos take some time to load so keep that typing notification going and/or let the user know it make take a moment...

Just to add, since it doesn't make sense you can't just attach a youtube video or at least an FB video, how about an experience where you use a URL template button to launch webview to some sort of "simplified" youtube streaming intermediary page? I'm using webviews to offload a bunch of UI limitations, AND to keep sensitive data out of transcripts...

Thanks @akhanukov for your response and suggestions. I'll give it a try downloading and hosting .mp4 version myself. But its weird that we can't just attach at least FB video. I'm trying to display a short video clip with some text(just like in the attachment below) to give a quick overview about the BOT when they enter 'help'. Here's the URL to the video clip used in the below sample -
https://www.facebook.com/VIX.Yum/videos/281170388953639/

sample_messenger_video

Yum! I forget if Messenger allows animated GIFs. I converted video to GIFs for Slack to get some action into it...

@akhanukov I tried with mp4 hosted myself, but no luck getting the video played.

@alexbudin , @benbrown just curious, were you able to get a video played in Messenger using botkit?

Messenger will autoplay gifs sent in chat by your bot, as long as they
arent in carousels I believe
On Wed, Oct 25, 2017 at 1:49 AM Alexander Khanukov notifications@github.com
wrote:

Yum! I forget if Messenger allows animated GIFs. I converted video to GIFs
for Slack to get some action into it...

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/howdyai/botkit/issues/451#issuecomment-339074975, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMUR2-O9qKtkmzN73yzaDDpAwSm-bnuzks5sviMjgaJpZM4KZWKs
.

Hey @ajith007, how large is the video? And it's exported as an .mp4 you've verified works in other players? Sometimes a poorly transcoded file won't render either. I went and looked and I believe I tried to keep the videos down to under 10MB. Have you modified the code above since or is that it? Are you getting any errors from FB in console when debugging?

Hi @akhanukov , I converted the mp4 to an animated gif using giphy.com, added the attachment as an image and it's working now. For my use case, this is good enough. Btw, the mp4 was only less than 4MB. Thanks again for all your inputs, really appreciate it. ๐Ÿ‘

I too have had issues with fb and videos
They have an asset api that allows you to upload the file to them and use
an id instead of a link.

Not sure if that helps serve the asset faster on the users end, probably
not but might be something to try
On Thu, Oct 26, 2017 at 12:13 AM ajith007 notifications@github.com wrote:

Hi @akhanukov https://github.com/akhanukov , I converted the mp4 to an
animated gif using giphy.com, added the attachment as an image and it's
working now. For my use case, this is good enough. Btw, the mp4 was only
less than 4MB. Thanks again for all your inputs, really appreciate it. ๐Ÿ‘

โ€”
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/howdyai/botkit/issues/451#issuecomment-339546156, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMUR21-AC13mwGY4AmNqOdG5qgcj_Cqrks5swAb3gaJpZM4KZWKs
.

Thanks @jonchurch, thats good to know. ๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings