Simple ... You're not as important to him, as his friends are.
Why does my crush ignore me when he is with his friends? He usually starts conversation with me in different classes, but whenever he is with his friends I become invisible.
In less if his friends all ready know he probley just doesn't want his friends to think he likes you because he might like you and he doesn't want his friends to know!
Try giving him the same treatment, if he won't talk to you when his friends are around then nothing says you have to hang on his every word whenever he decides to talk to you.
Smile and look the other way.