Code to copy video iframe code once clicking a button in php

Using javascript define a fucntion:

function copy(content) {
var aux = document.createElement(“input”);
var var1='<video width=”640″ height=”440″ controls>’+
‘<source src=”‘+content+'” type=”video/3gp”>’+
‘<source src=”‘+content+'” type=”video/3gpp”>’+
‘<source src=”‘+content+'” type=”video/webm”>’+
‘<source src=”‘+content+'” type=”video/avi”>’+
‘<source src=”‘+content+'” type=”video/mp4″>’+
‘<source src=”‘+content+'” type=”video/ogg”>’+
‘<source src=”‘+content+'” type=”video/mov”>’+
‘Your browser does not support the video tag.’+
‘</video>’;
console.log(var1);
aux.setAttribute(“value”, var1);
document.body.appendChild(aux);
aux.select();
document.execCommand(“copy”);
document.body.removeChild(aux);
}

Use below code to create buttons:

<?php      $copylinks=”http://mbtvapps3prod.s3.amazonaws.com/$videotrgeturl”;
?>

<button onclick=”copy(‘<?php echo $copylinks; ?>’);”>Copylink</button>