Pradeep
Pradeep

Reputation: 5540

How to display the Audio and Video in Skype using Bot Framework version 3?

I am working on bot framework technology, in one of my project I was implemented the concept like to display the audio file and video file for that I have to wrote below lines of code in my MessagesController.

 ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
    Activity replyToConversation = activity.CreateReply("Welcome to **Marriott Hotels**." + "(Hi)");
    replyToConversation.Recipient = activity.From;
        replyToConversation.Type = "message";
        //replyToConversation.AttachmentLayout = AttachmentLayouts.Carousel;
        replyToConversation.Attachments = new List<Attachment>();
      if (activity != null && activity.GetActivityType() == "message" && activity.Text.ToLower() == "video")
        {
            replyToConversation.Attachments.Add(new Attachment()
            {

                ContentUrl = "https://1drv.ms/v/s!At-JUB9_wu9Ct3LEMJtNj_ZP26r6",
                ContentType = "video/mp4",
                Name = "xxxxx hotel video"
            });
            var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
        }   
        else if (activity != null && activity.GetActivityType() == "message" && activity.Text.ToLower() == "file")
        {
            replyToConversation.Attachments.Add(new Attachment()
         {
             ContentUrl = "https://codeload.github.com/jeffhollan/BotFrameworkSample/zip/master",
                ContentType = "application/zip",
                Name = "Download ZIP File"
            });
            var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
        }

        else if (activity != null && activity.GetActivityType() == "message" && activity.Text.ToLower() == "audio")
                    {
                        replyToConversation.Attachments.Add(new Attachment()
        {
            //ContentUrl = "http://gaana.com/song/ulagam-oruvanukka",
            ContentUrl = "http://www.zzz.com/eatfood.wav",
                            ContentType = "audio/wav",
                            Name = "Play Audio" + "(Music)"
                        });
                        var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
                    }

After added the code and publish my application into azure and added skype channel then now I start to chat with my bot then its display video prompt but when I click that it’s not playing its shows error like this below figure.

enter image description here enter image description here Please tell me how to resolve this issue. Pradeep

Upvotes: 0

Views: 947

Answers (1)

Lars
Lars

Reputation: 10092

The link you are sending is a link to a web page that hosts the video, not a link to the video itself, thus it can't be rendered in Skype.

To get a link to the actual video you need to click on the "Download" button and then read the network traffic to get the actual video link.

enter image description here

For the Chrome browser you can hit F12 to open developer tools and then click on the "Network" tab. If you filter by "download" you should see the url you need.

In your case: https://p4undw.dm2304.livefilestore.com/y3mAshht4PfgS1sMstAKck_EgQPD7t5tuZimQl6WPEeW6fOBpmrAhhQATITKiEBPN_lmlSaC51OhM0QTIUPEZADQCkll6kuG2dstCSfTGZr3go4Ga58hhqQj8w7_54sGTL8jmwySpzimm2CvUyeBaWn4XM3HAeT0LNHph8S0M83v3g/What%20you%20need%20to%20know%20about%20Raspberry%20Pi%202.mp4?download&psid=1

enter image description here

Upvotes: 2

Related Questions