1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<script type="text/javascript">
$(document).ready(function() {
var tabId = <?php echo json_encode($tab)?>;
for(i=0;i<tabId.length;i++) //Parcours le tableau contenant les vidéos
{
// This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
//This function creates an <iframe> (and YouTube player) after the API code downloads.
alert("blablabla ");
// Crée l'iframe de la video
var player1 = new YT.Player(tabId[i],{
height: '160',
width: '250',
videoId: tabId[i].toString(),
events: {}
});
} // fin du FOR
});
</script> |
Partager