Video

You can send video files to visitors using this widget. There are two types of videos that you can send.

1. Videos on YouTube

You can send URLs of videos that are available on YouTube to your website visitors.

Example:

{  
   "type":"video",
   "text": "Bots to rule the Workplace",
   "url": "https://www.youtube.com/watch?v=qO1p6uLhZrM",
}

2. Videos on a server

You can send URLs of videos that have been uploaded on a particular server along with subtitles and thumbnails.

Example:

{  
   "type":"video",
   "thumbnail":"https://zoho.com/images/bot.png",
   "url": "https://zoho.com/videos/bots.mp4",
   "autoplay" : true,
   "text": "Bots to rule the Workplace",
   "subtitles": "https://zoho.com/videos/bots.srt"
}
AttributeMandatoryDescriptionValues
typeYesThe type of input to be displayed to the visitorvideo
urlYesThe URL of the video that you want to send to the visitor{  
   "url":"youtube or mp4 URL",
}
textYesThe text to be displayed to the visitortext
subtitlesNoThe URL of the subtitle file(if any)

{  
   "subtitles":"subtitle URL",
}​

thumbnailNoThumbnail of the video that will be sent to the visitor

{  
   "thumbnail":"thumbnail URL",
}​

 

Note:

Subtitles and Thumbnails are only applicable for sharing videos that have been uploaded to a server. You do not need to include them while sharing URLs of videos that are on YouTube.

Use Case 1: YouTube Videos

Context Handler function:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
    {  
   "type":"video",
   "thumbnail":"https://zoho.com/images/bot.png",
   "url": "https://zoho.com/videos/bots.mp4",
   "autoplay" : true,
   "text": "Bots to rule the Workplace",
   "subtitles": "https://zoho.com/videos/bots.srt"
}
  ]);
prompt = Map(); 
prompt.put("param_name", "reply"); 
prompt.put("data", response); 
result.put("prompt", prompt); 
result.put("todo", "prompt");
return result;

Execution function:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
    {
      "type":"video",
   "thumbnail":"https://zoho.com/images/bot.png",
   "url": "https://zoho.com/videos/bots.mp4",
   "autoplay" : true,
   "text": "Bots to rule the Workplace",
   "subtitles": "https://zoho.com/videos/bots.srt"
     }
  ]);
result.put("data", response);
return result;

Use Case 2: Server Videos

Context Handler function:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", "replies": [
{  
   "type":"video",
   "thumbnail":"https://zoho.com/images/bot.png",
   "url": "https://zoho.com/videos/bots.mp4",
   "autoplay" : true,
   "text": "Bots to rule the Workplace",
   "subtitles": "https://zoho.com/videos/bots.srt"
}
  ]);
prompt = Map(); 
prompt.put("param_name", "reply"); 
prompt.put("data", response); 
result.put("prompt", prompt); 
result.put("todo", "prompt");
return result;

Execution function:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", "replies": [
{
   "type":"video",
   "thumbnail":"https://zoho.com/images/bot.png",
   "url": "https://zoho.com/videos/bots.mp4",
   "autoplay" : true,
   "text": "Bots to rule the Workplace",
   "subtitles": "https://zoho.com/videos/bots.srt"
}
  ]);
result.put("data", response);
return result;

Output: