Add video clip
This guide provides the way that you can insert a video from external source or from your computer into the questionnaires.
then please see examples below:
- video with external source
- video with upload from computer
You can do that with steps below:
1.Insert video from external source
-Copy link of video from external source that support streaming video like as youtube
-Use tool ‘Media embed’ to insert to question text or answer text
2.Insert videos from attachment of questionnaire
- Open questionnaire, go to Attachments tab, and upload files to here
- Copy Resource id of questionnaire, then open Workflow prompt, then run this script with copied id to get link of attachment
number qRId = ;//resource id of questionnaire
number fIndex = 0;//index of file in Attachments (0,1,2..)
Attachment att = new Attachment("", qRId);
array fs = att.GetChildAttachments(qRId);
att = fs[fIndex];
array permissions = {{2, "Read"}};
updateUserPermission(att.ResourceId, permissions);
"/public/getattachment.aspx?guid="+ getResourceGuid(att.ResourceId) + "&noattach=1";
- Insert this script in to Javascript of question, remember use link of video in above step
Question.bind('afterShowQuestion', function() {
//this is demo create a element to add video player, or you can add it into question text
var el = $('<div>').appendTo('.cg-ui-question > .cg-ui-text');
//apply player
el.mediaPlayer({
m4v: "link attachment", //for video mp4, mpeg
//flv: "link attachment ", //for flash video
//mp3: "link attachment ", //for music mp3
});
});
- For Advance setting (use player with list, poster, caption,…), please refer to questionnaire: http://cg.catglobe.com/QuestionnaireModule/Editor/QuestionnaireJsEditor.aspx?id=506
You save your questionnaire then this is finished here.