I have created a plugin to sell videos using woocommerce. The plugin adds license key to view the purchased video. I am facing issue with the youtube video. When i put license key and ajax loads video in a popup. I am getting this error:
Refused to load the image '<URL>' because it violates the following Content Security Policy directive: "img-src 'self' <URL>"
The problem is popup is hidden on page load and the audio of the video starts playing but the video stays on its initial state.
Here is my code:
function submit_license(control,form_id) {
//alert(form_id);
jQuery(control).attr("disabled","disabled");
jQuery(control).val('Loading..');
jQuery.post(obj_unvq_custom.ajax_url,jQuery("#"+form_id).serialize()+"&action=license&_wpnonce="+obj_unvq_custom.nounce, function(data){
jQuery(control).val('Submit');
jQuery(control).removeAttr("disabled");
var decoded_data = jQuery.parseJSON(data);
if(decoded_data.code == "error")
{
alert(decoded_data.error);
}
else
{
close_modal("activation_modal");
jQuery('#TB_ajaxContent').html('');
tb_show('', '#TB_inline?height=300&width=400&unvq=true&inlineId=video_popup'+decoded_data.order_id);
if(video_url != "undefined")
{
jQuery("div.player_responsive").find('iframe').attr('src',video_url);
}
}
});
}