<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[autoplay al caricamento della pagina]]></title><description><![CDATA[<p dir="auto">salve<br />
utilizzo questo script per lanciare il play cliccando su un immagine, come posso attivare il play al caricamento della pagina</p>
<pre><code>&lt;form  id="fluxa" name="fluxa" method="get"&gt;
&lt;audio style="display:none;" controls id="yourAudio" autoplay&gt;
&lt;source id="flusso" src="https://stream" type="audio/mp3"&gt;
&lt;/audio&gt;
&lt;/form&gt;
&lt;a id="audioControlRR" href="#" &gt;
&lt;img id="play" src="img/play.png" &gt;
&lt;img id="pause" src="img/pause.png" &gt;
&lt;/a&gt;
&lt;script&gt;
var yourAudio = document.getElementById('yourAudio'),
    ctrl = document.getElementById('audioControlRR'),
    playButton = document.getElementById('play'),
    pauseButton = document.getElementById('pause');

function toggleButton() {
    if (playButton.style.display === 'none') {
        playButton.style.display = 'block';
        pauseButton.style.display = 'none';
    } else {
        playButton.style.display = 'none';
        pauseButton.style.display = 'block';
    }
}

ctrl.onclick = function () {

    if (yourAudio.paused) {
        yourAudio.play();
    } else {
        yourAudio.pause();
    }
    
    toggleButton();

    // Prevent Default Action
    return false;
};
&lt;/script&gt;
</code></pre>
<p dir="auto">grazie</p>
]]></description><link>https://dev.connect.gt/topic/243099/autoplay-al-caricamento-della-pagina</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 16:29:06 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/243099.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Oct 2020 10:01:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to autoplay al caricamento della pagina on Thu, 12 Nov 2020 12:58:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/djjunior" aria-label="Profile: djjunior">@<bdi>djjunior</bdi></a> basta che aggiungi un eventListener sull'onload e gli fai lanciare la funzione che fa il play.</p>
<pre><code>&lt;script&gt;
  window.addEventListener("load", function(event) {
    console.log("Esegui la funzione che vuoi tu.");
  });
&lt;/script&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1278938</link><guid isPermaLink="true">https://dev.connect.gt/post/1278938</guid><dc:creator><![CDATA[juanin]]></dc:creator><pubDate>Thu, 12 Nov 2020 12:58:11 GMT</pubDate></item></channel></rss>