DOM Exception

I am getting this error in while running the project in localhost, But not in server. Could you please tell me how to fix this issue?

DOMException: play() failed because the user didn’t interact with the document first. https://goo.gl/xX8pDD

You can find the full description by opening the provided link: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

Did you actually read that link?