Was he flirting with my friend in front of me?

This guy I’ve been dating for a few months really acted strange when we had a coincidental trip together to NY. We both had to go to NY so I scheduled my time around his time there, and he knew this. We made a lot of plans and he seemed excited. When I got there he invited me to some place and we met, I was with my girl friend. I sat next to him but I was talking mostly to my friend as I was nervous. He would talk over me and talk to my friend Tee. He would stand and sit next to her and talk more to her. He barley talked to me at all. But when I talked to one of his friends, he seemed jealous. He said he was drunk. The next day I told him that I felt invisible, he said that we “think differently”. I told him I have trouble connecting with him because I feel a wall. He said he’s not looking for a relationship and doesn’t want to open up (as he already told me before) but I told him I just want to connect with him to get to know him. I don’t know him well enough to decipher if I would even want a relationship with him. While we were in NY he would barley talk to me. He would message me on IG but I’d ignore it. I cried because he planned all these things w me and didn’t do it. I left and he messaged me asking if I left. he told me he lost his phone and has been on his iPad. I know that it was a lie. I stopped talking to him and so has he. I wish I knew what I did wrong.
Was he flirting with my friend in front of me?
Post Opinion