//Get the questions
var oQText = wscScripting.getQuestionByDataPipingCode('TEXTQUESTION');
var oQCheckUpload = wscScripting.getQuestionByDataPipingCode('CHECKUPLOAD');
//Set the hidden question to false
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[1]);
var oLink = document.createElement('link');
oLink.type = "text/css";
oLink.rel = "stylesheet";
oLink.href = "https://cdn.addpipe.com/2.0/pipe.css";
oLink.onload = function () {
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.src = 'https://cdn.addpipe.com/2.0/pipe.js';
oScript.onload = function () {
var pipeParams = {
size: { width: 640, height: 390 },
qualityurl: "avq/360p.xml",
accountHash: "put-your-account-hash-here",
eid: "put-your-eid-here",
payload: "userId: [@RECALLCODE@], jobId: put-your-job-id-here",
mrt: 120,
sis: 0,
asv: 1,
mv: 0,
dpv: 0,
ao: 0,
dup: 1,
};
PipeSDK.insert("{QuestionContainer}", pipeParams, function (recorderInserted) {
//Desktop video RECORDING UPLOAD is complete event
recorderInserted.onUploadDone = function (recorderId, streamName, streamDuration, audioCodec, videoCodec, fileType, audioOnly, location) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[0]);
}
//Desktop RECORDING STARTED event
recorderInserted.onRecordingStarted = function (recorderId) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[1]);
}
//Desktop video UPLOAD success event
recorderInserted.onDesktopVideoUploadSuccess = function (recorderId, filename, filetype, videoId, audioOnly, location) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[0]);
}
//Desktop video UPLOAD STARTED event
recorderInserted.onDesktopVideoUploadStarted = function (recorderId, filename, filetype, audioOnly) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[1]);
}
//Mobile video UPLOAD SUCCESS event
recorderInserted.onVideoUploadSuccess = function (recorderId, filename, filetype, videoId, audioOnly, location) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[0]);
}
//Mobile video UPLOAD STARTED event
recorderInserted.onVideoUploadStarted = function (recorderId, filename, filetype, audioOnly) {
wscScripting.selectChoice(oQCheckUpload, oQCheckUpload.choices[1]);
}
});
};
document.getElementsByTagName('head')[0].appendChild(oScript);
};
document.getElementsByTagName('head')[0].appendChild(oLink);