There is a some situation when you need to play you tube video in php.Onclick on some where or on page load or some thing else .He you can get the sollution of your problem,
In my situation i need to play a you tube video in popup on click of a link and on page load. So to fulfill my need i am using color box to show pop up like below example :-
Before using of pop up you have to download COLOR BOX library from Here and include it on the top of your page and don't forget to include jquery library as well at the top of you page.
Now i want to play my video every time on page load :
Below is my video in iframe and i want to play this on page load every time in popup.
<div style="display: none;">
<div id="popup-message">
<p style="background: #fff;">
<iframe src="http://www.youtube.com/embed/ybTyuu6wrNs" width="601" height="481"></iframe>
</p>
<span style="position:absolute; bottom:0px;">
<input type="checkbox" style="vertical-align:top;" id="showAgain"> Don't Show again</span>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$.colorbox({ href: '#popup-message', inline: true,width: 650, height: 550, scrolling: false, opacity:.8 });
}
</script>
Now i want to play you tube video while click on a link in popup :
Below is my link and i want to play my you tube video when any body click on this link.Below is my example php code
<a href="http://www.youtube.com/embed/ybTyuu6wrNs" class="example6">
<strong>
Play My Video
</a>
Below is my Jquery code:
<script type="text/javascript">
$(document).ready(function(){
$(".example6").colorbox({iframe:true, innerWidth:600, innerHeight:430, scrolling: false, opacity:.8});
});
</script>
If you like this post please don't forgot to notify me to post a comment .
Happy coding guys :)
In my situation i need to play a you tube video in popup on click of a link and on page load. So to fulfill my need i am using color box to show pop up like below example :-
Before using of pop up you have to download COLOR BOX library from Here and include it on the top of your page and don't forget to include jquery library as well at the top of you page.
Now i want to play my video every time on page load :
Below is my video in iframe and i want to play this on page load every time in popup.
<div style="display: none;">
<div id="popup-message">
<p style="background: #fff;">
<iframe src="http://www.youtube.com/embed/ybTyuu6wrNs" width="601" height="481"></iframe>
</p>
<span style="position:absolute; bottom:0px;">
<input type="checkbox" style="vertical-align:top;" id="showAgain"> Don't Show again</span>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$.colorbox({ href: '#popup-message', inline: true,width: 650, height: 550, scrolling: false, opacity:.8 });
}
</script>
Now i want to play you tube video while click on a link in popup :
Below is my link and i want to play my you tube video when any body click on this link.Below is my example php code
<a href="http://www.youtube.com/embed/ybTyuu6wrNs" class="example6">
<strong>
Play My Video
</a>
Below is my Jquery code:
<script type="text/javascript">
$(document).ready(function(){
$(".example6").colorbox({iframe:true, innerWidth:600, innerHeight:430, scrolling: false, opacity:.8});
});
</script>
If you like this post please don't forgot to notify me to post a comment .
Happy coding guys :)