Reputation: 5540
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.
Please tell me how to resolve this issue.
Pradeep
Upvotes: 0
Views: 947
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.
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.
Upvotes: 2