How to close or stop an iframe from playing on tab change?

i have html audio player in my first tab. how do i stop it from playing audio when i go to another tab??