Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Why doesn’t YouTube iframe autoplay with sound even when I set mute=0? [duplicate]

$
0
0

I’m trying to make a YouTube video autoplay with sound as soon as the page loads.Here’s my current code:

<iframe  id="yt-video"  width="100%"  height="100%"  src="https://www.youtube.com/embed/DqCXbJ7mr5E?autoplay=1&mute=0&loop=1&playlist=DqCXbJ7mr5E&rel=0&playsinline=1&controls=0&modestbranding=1&enablejsapi=1"  frameborder="0"  allow="autoplay; encrypted-media; picture-in-picture"  allowfullscreen></iframe>

I’ve tried setting mute=0, allow="autoplay", and enabling the YouTube JS API, but the video still won’t start with sound unless I interact with the page (like clicking or scrolling).

  • Is there any way to make YouTube autoplay with audio right when the page loads?
  • Or is this something blocked by browsers now?
  • Are there any workarounds (e.g., through JavaScript or YouTube API)?

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>