Prevent background video stopping while closing popup video

I used great code* to make the pop-up video stop. Unfortunately it stops background video which played in the Hiro section too.
After a while I found this and solved it:

*The code to stop the video from here: