I'm trying to make life as easy as possible for streamlining my websites integration with our YT watch pages (our videos are released early on our website) - so here is the problem.
I'm using the VideoID to pull comments, view counts, title, description and other information directly from the watch page, however, it does not work with the iframe. I've got my iframe set to a php variable, and i need to set the video id to be a variable inside the iframe.
<?php
$videoid="GeSQHeI5YeQ";
$iframelink= '<iframe width="640" height="360" src="//www.youtube.com/embed/$videoid" frameborder="0" allowfullscreen></iframe>'; (shows a player with no file)
?>
and lower in the page i use the following to call the iframe (works fine)
<?php echo $iframelink ?>
can anyone help me please? i have next to no real experiance with any of this.
The single quotes are messing with your code:
Try this:
<?php
$videoid="GeSQHeI5YeQ";
$iframelink= <<< EOF
<iframe width="640" height="360" src="http://www.youtube.com/embed/$videoid" frameborder="0" allowfullscreen></iframe>
EOF;
echo $iframelink;
?>