Chrome (Android) video autoplay inside Angular 2+ component

后端 未结 5 1606
臣服心动
臣服心动 2020-12-10 19:00

What does not work:

If I put a video tag with \"autoplay\" (see below) into the template of an Angular 2+ component with the goal of autoplaying on mobile

5条回答
  •  感动是毒
    2020-12-10 19:31

    I was searching for this issue a lot and I put the muted attribute like this:

    [muted]="true" rather than just muted

    and now it works

    
    

    Chrome has a policy to not let videos autoplay if the user has not first interacted with the page however if its a muted video chrome allows it. The problem here is that for some reason muted value goes as false when you just put muted in angular.

提交回复
热议问题