Ekim 23, 2018

Site Arka Planın’da YouTube Videolari Oynatın

<div style="position: fixed; z-index: -99; width: 100%; height: 100%">
  <iframe frameborder="0" height="100%" width="100%" 
    src="https://youtube.com/embed/qtVsVJ9V338?autoplay=1&controls=0&showinfo=0&autohide=1">
  </iframe>
</div>
  • Yukardaki kodu sitemizin <body> tagından hemen sonrasına ekliyoruz ve kayıt ediyoruz.
Videoların Sesini Otomatik Kısma Gerekli Kod
  • Aşağıdaki kodumuzu sitemizin <body> tagından hemen sonra ekliyoruz.
<script>
var tag = document.createElement('script');

        tag.src = "//www.youtube.com/iframe_api";
        var firstScriptTag = document.getElementsByTagName('script')[0];
        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

        var player;

        function onYouTubeIframeAPIReady() {
            player = new YT.Player('ytplayer', {
                events: {
                    'onReady': onPlayerReady
                }
            });
        }

        function onPlayerReady() {
            player.playVideo();
            // Mute!
            player.mute();
        }
		</script>
<div style="position: fixed; z-index: -99; width: 100%; height: 100%">
  <iframe frameborder="0" height="100%" width="100%" id="ytplayer" type="text/html" src="https://www.youtube.com/embed/zJ7hUvU-d2Q?rel=0&enablejsapi=1&autoplay=1&controls=0&showinfo=0&loop=1&iv_load_policy=3" frameborder="0" allowfullscreen></iframe>
</div>

 

You may also like...

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


Fatal error: Uncaught Error: Call to undefined method Ressio_HtmlOptimizer_Dom_Element::addChild() in /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/dom.php:182 Stack trace: #0 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/widgets/widgets.php(66): Ressio_HtmlOptimizer_Dom->appendScriptDeclaration('!function(e,t,n...', Array, Object(Ressio_HtmlOptimizer_Dom_Element)) #1 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/widgets/widgets.php(151): Ressio_Plugin_Widgets->injectJsLoader(Object(Ressio_HtmlOptimizer_Dom), Object(Ressio_HtmlOptimizer_Dom_Element)) #2 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php(117): Ressio_Plugin_Widgets->onHtmlIterateTagSCRIPTBefore(Object(Ressio_Event), Object(Ressio_HtmlOptimizer_Dom), Object(Ressio_HtmlOptimizer_Dom_Element)) #3 /home/altiltoy/siteler/serdarakyol.com/wp-content in /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/dom.php on line 182