Preview may not work with flash player & Async Player!
"; preview.innerHTML += code; } else { preview.innerHTML = code; } txtOutput.innerHTML = code; } // Main Function Close //############ EXTRACT VIDEO/PLAYLIST ID ################ function extractVideoID(vidID) { if (vidID == "" || vidID.length < 11) { sweetAlert("Error", "No video ID detected.Please enter a video/playlist URL. Placeholder video is used.", "error"); pMODE = ""; return "ffiJNSy8CBA?"; } var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; var match = vidID.match(regExp); var list = vidID.match("list=([a-zA-Z0-9\-\_]+)&?"); list = list ? list[1] : ""; if (match && match[7].length == 11) { pMODE = ""; filler = "?"; return (match[7]); } else if (list != "") { pMODE = "videoseries?list="; filler = ""; return list; } else { swal("Oops..", "Could not extract video/playlist ID", "error"); return "VIDEO_ID"; } } function getThumb(vidID) { if (vidID.length == 11 || vidID.length < 14) { return " src='http://i.ytimg.com/vi/" + vidID + "/hqdefault.jpg'"; } else { return " src='https://codegena.com/assets/images/no_image_available.jpg'"; } } function timeInS(str) { var p = str.split(':'), s = 0, m = 1; while (p.length > 0) { s += m * parseInt(p.pop(), 10); m *= 60; } return s; } //############SELECT ALLt######################### function SelectAll(txtOutput) { document.getElementById(txtOutput).focus(); document.getElementById(txtOutput).select(); } //############ RESET ########################## function refresh() { var allChildNodes = document.getElementById("optionals").getElementsByTagName('*'); for (var i = 0; i < allChildNodes.length; i++) { allChildNodes[i].disabled = false; } document.getElementsByTagName("form")[0].reset(); document.getElementById("preview").innerHTML = "You will see preview here"; } //Load Disqus on click with jquery $(document).ready(function() { $('.show-comments').on('click', function(){ $("#disqus_thread").css({"background-color": "white", "padding": "24px","border-radius":"5px","width":"50%","min-width":"200px"}); var disqus_shortname = 'codegena'; // Replace this value with *your* username. // ajax request to load the disqus javascript $.ajax({ type: "GET", url: "//" + disqus_shortname + ".disqus.com/embed.js", dataType: "script", cache: true }); // hide the button once comments load $(this).fadeOut(); }); });
0 Comments