How to give autoplay on video in mobile version Chrome

Asked

Viewed 1,627 times

0

I’m trying to start the video in autoplay in mobile version test in firefox and it worked on Chrome not, follow the code of the tag video I’m using

<video class="video" autoplay muted loop >

if anyone has any ideas thank you

Show 2 more comments

1 answer

2

Browsers have their policy of self-perform content tagged <video> using mobile. iOS, for example, does not allow autoplay (see here official Apple documentation).

In relation to Android, Firefox accepts the autoplay, quiet. Already Chrome, will only self-perform the video if it has both attributes autoplay muted (muted means audio-free) and if in the browser settings the Data economy is disabled and if in "Settings > Site Settings > Media" the option "Automatic playback is enabled".

I believe that in the case of iOS (which does not allow) and in the case of Chrome (allows within the above criteria), it is to avoid consumption of cellular network data without a previous action of the user.

  • thinking about it I did like, "I don’t know if it’s the right way"

  • var video = Document.getElementById("video"); video.load(); $(window). click(Function(){ video.play(); });

  • 1

    @Julianosouza It would only help to do anything with user gesture if the Data Saving is disabled.

  • @Julianosouza I will need to leave now, but later I will give more research in depth on the subject and if I have news I warn you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.