Waqqar khan
Waqqar khan

Reputation: 1

Html video playing issue

This is my code

<video autoplay loop id="myVideo" >
<source src="video/alliance.mp4" type="video/mp4">
</video>

If I add a "muted" attribute to the video tag, then it plays fine but when I remove the muted attribute, the video does not play. How to solve this issue? Because I want to have sound with it.

Upvotes: 0

Views: 65

Answers (1)

Narendra
Narendra

Reputation: 4574

As per Google Autoplay Policy

  • Muted autoplay is always allowed.
  • Autoplay with sound is allowed if: User has interacted with the domain (click, tap, etc.). On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound. On mobile, the user has [added the site to their home screen].
  • Top frames can delegate autoplay permission to their iframes to allow autoplay with sound.

Upvotes: 1

Related Questions