You are feeling "Guilty" that's why you are having panic attacks. When you tell him the rest of what he needs to know the attacks will stop.
I can't say your husband will stick around after you tell him, but I do know you will feel better and maybe find out why you cheated in the first place. You have to realize he is going to need some space, time apart, and he may yell and scream. But if you truly love him then you must listen to him. He's aloud to feel pain just as you are.
I think your going to be o.k, unless you want to end it. Let's make sure there isn't a next time. He will forgive you just as you need to forgive your self.
I'm sorry you are having such a rough time of it right now. A few things come to mind for me when I read your post. First, I have to ask, why the cheating? What lead to that? Were you depressed when you did it and possibly trying to apply a band aid? Are there issues in your relationship? It's important to do some soul searching about this as it will help you explain yourself to your husband.
I'm glad you are getting treatment for your anxiety. Panic attacks are terrible! Are you seeing a psychiatrist or regular doctor-- who overseas the medication? Might be worth checking in with them on the issue of these break through panic attacks. You will still have ups and downs when on medication-- it rounds out the edges but you still 'feel' real life things in an impactful way-- you don't become totally numb or anything (as that isn't good either). But really important, do you see anyone that you talk to like a psychologist? You should invest in this if you are not currently seeing one. May help you sort out why this happened and where to go from here.
I can't tell you whether or not you should tell your partner that you played with yourself on video. I can understand your fear in this. But you are having such severe anxiety holding it in as well. I think you two will need couple's counseling to move past this. But again, the big question is what is underneath it all. What led to the behavior to begin with. good luck