1/*function stopVideo() { 2 var iframe = document.querySelector('#youtube-video'); 3 if (iframe) { // Vérifie si l'iframe existe 4 var iframeWindow = iframe.contentWindow; 5 iframeWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 6 } 7} 8 9function playYouTubeVideo() { 10 var iframe = document.querySelector('#youtube-video'); 11 if (iframe) { // Vérifie si l'iframe existe 12 var iframeWindow = iframe.contentWindow; 13 iframeWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); 14 } 15} 16 17$('#actualiteCarousel').on('slide.bs.carousel', function() { 18 $(this).find('video').each(function() { 19 this.pause(); // Met en pause la vidéo en cours lors du changement de slide 20 }); 21 stopVideo(); // Met en pause la vidéo YouTube 22}); 23 24$('#actualiteCarousel').on('slid.bs.carousel', function() { 25 $(this).find('.active video').each(function() { 26 this.play().catch(function(error) { 27 console.log('Erreur de lecture : ', error); 28 }); 29 }); 30 if ($(this).find('.active iframe').length > 0) { 31 playYouTubeVideo(); // Joue la vidéo YouTube si elle est dans la slide active 32 } 33}); 34 35function adjustCarouselHeight() { 36 var maxHeight = 0; 37 38 // Parcourt toutes les vidéos et iframes du carrousel 39 $('#actualiteCarousel .carousel-item').each(function() { 40 var elementHeight = $(this).find('video, iframe').height(); 41 if (elementHeight > maxHeight) { 42 maxHeight = elementHeight; 43 } 44 }); 45 46 // Ajuste la hauteur du carrousel en fonction de la plus grande vidéo ou iframe 47 if (maxHeight > 0) { 48 $('#actualiteCarousel .carousel-inner').css('height', maxHeight + 'px'); 49 } 50} 51 52// Appeler la fonction après le chargement des éléments de la page 53$(document).ready(function() { 54 adjustCarouselHeight(); // Ajustement initial 55 56 // Réajuster la hauteur après le changement de slide 57 $('#actualiteCarousel').on('slid.bs.carousel', function() { 58 adjustCarouselHeight(); 59 }); 60}); 61*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.