I'm editing a website for a client, and he never mentioned that there will be some javascript edits included, but here we are. Since I'm not familiar with js at all, I could really really use your help. So, the thing is, there is a video (so called playable ad for mobile) in the header. When you click on it, you get to play some game with the sound ON. What my client wants is when you scroll down and the video is not visible anymore to MUTE the sound, and UNMUTE it when you scroll up. I haven't built this website, I'm just editing it.
I've spent days on this, reading different posts and solutions here and on Google, but whatever I tried didn't work. Since I'm not familiar with Javascript, I suppose that I'm doing something wrong. I suppose that I can't just copy someone else's code and expect it to work, but I probably have to change variable name or something else. But I don't know how to change it and make it work.
<a class="img" href="">
<iframe src="https://appsposure.com/wp-content/uploads/2019/06/bask.html" scrolling="no" frameborder="0"></iframe>
<img class="phone-img lazyloaded" src="https://appsposure.com/wp-content/uploads/2019/06/phone-2.png" alt="" data-lazy-src="https://appsposure.com/wp-content/uploads/2019/06/phone-2.png" data-was-processed="true"><noscript><img class="phone-img" src="https://appsposure.com/wp-content/uploads/2019/06/phone-2.png" alt=""></noscript>
</a>
Here is the solution that I've tried multiple times, but it doesn't work since I probably don't know how to adjust it for my website.
Also, here is the link to the website I'm working on (I'm talking about the video in the header, the one with basketball player on it).
If there is anyone willing to help me, I would really appreciate it, since I'm struggling for days, and I'm just too stupid for this.