diff --git a/cms/templates/settings.html b/cms/templates/settings.html index 204cad480967..291f39cd83c3 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -31,30 +31,15 @@ function(doc, $, CourseDetailsModel, MainView) { CourseDetailsModel.prototype.videosourceSample = function() { if (this.has('intro_video')){ - //We teach videosourceSample how to handle properly DMCloud URLS and DM Classic ID that might be given - //as they are now stored in the db just like Youtube IDs - //but we also teach videosource Sample to handle DM Cloud ID's as they might also be an input, - //not from db as we explained, but directly from client that inputs DM Cloud ID and not DM Cloud URL - //(unless he computes md5sum in his head of course!). + // This allow videosourceSample to handle public DailyMotion ID that might be given instead of Youtube's var inputToProcess = this.get('intro_video'); var inputProcessed = inputToProcess; - //now if we have a DMCloud ID (we allow capital letters as user may not be "case sensitive") - //we can only give the DMCloud ID as it is not possible to compute here the signed URL - if(/^[a-fA-F0-9]{24}$/.test(inputToProcess)){ - inputProcessed = inputToProcess; - } - //now if we have a DMCloud URL provided by server there is nothing to do - //we do nothing here (case is shown for clarity only) - else if(/^https:\/\/cdn\.dmcloud\.net\//.test(inputToProcess)){ - inputProcessed = inputToProcess; - } - //if we have DM Classic ID (public or private) - else if((/^[a-zA-Z0-9]{6,10}$/.test(inputToProcess)) || (/^[a-zA-Z0-9]{19}$/.test(inputToProcess))){ + // if we have DailyMotion ID (public or private) + if ((/^[a-zA-Z0-9]{6,10}$/.test(inputToProcess)) || (/^[a-zA-Z0-9]{19}$/.test(inputToProcess))) { inputProcessed = "//www.dailymotion.com/embed/video/" + inputToProcess; } - //if we are in none of these cases then we do it as it was done before - //we keep the original solution used to handle youtube videos - else{ + // keep the original solution used to handle youtube videos + else { inputProcessed = "//www.youtube.com/embed/" + inputToProcess; } return inputProcessed; @@ -382,7 +367,7 @@