OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

YouTube: How to present embed video with sound unmuted

  • Thread starter Thread starter usman
  • Start date Start date
U

usman

Guest
Code:
<iframe id ="videoPlayer" src="https://www.youtube.com/embed/uNRGWVJ10gQ?rel=0&autoplay=1&muted=0" width="560" height="315" frameborder="0" allowfullscreen></iframe>

I am doing this way but autoplay does not work . When i set muted=1 then autopaly works great . Any suggestion?

I tried to replace JS like below

Code:
var iframe = document.getElementById('videoPlayer');
            iframe.src = videoUrl + "&mute=1";
            iframe.setAttribute('allow', 'autoplay; encrypted-media');

but it still shows the same behaviour

<pre><code><iframe id ="videoPlayer" src="
" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</code></pre>
<p>I am doing this way but autoplay does not work . When i set muted=1 then autopaly works great . Any suggestion?</p>
<p>I tried to replace JS like below</p>
<pre><code>var iframe = document.getElementById('videoPlayer');
iframe.src = videoUrl + "&mute=1";
iframe.setAttribute('allow', 'autoplay; encrypted-media');
</code></pre>
<p>but it still shows the same behaviour</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top