Safari doesn't play any media
I have been facing a problem with Safari. Sometimes it doesn't play any media (video or gif) at any site (Facebook, Twitter, Youtube or even embedded video). The video might start playing sound but it's displaying nothing (blank video screen or loading icon). Also if I open a site like YouTube Safari might freeze and become unresponsive. So I have to restart it. I've noticed that the problem occurs after I play one specific game on Facebook. If I close and reopen safari the problem doesn't occur. If I play that specific game the problem occurs again so I have to restart again. The problem doesn't occur at any other browser. Can anyone suggest any solution? (the game I mention is Hero Wars)
MacBook Air 13″, macOS 12.3