You could do that using url parameters. For example, link to your site would be something like: www.mysite.com/something?video_url=<some youtube link>
. Then, on you page you can have event handler ($(document).ready(function(){...})
) which would check if there is a 'video_url' param present in the url, and if it is just show the popup with <some youtube link>
loaded in it.
For example (getParameterByName(name)
found here):
// a function that gets the value of query parameter
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// jquery used, but not really needed
$(document).ready(function() {
var video_url = getParameterByName("video_url");
// your function that shows the popup
showPopup(video_url);
});