Hp Webcam problems

Well i brought my laptop to my friends house for new years to web cam with my friends, and the webcam started acting up. Whenever i use any webcam based program the video chat box freezes up. Normally it wouldn’t freeze up or have pixled quality. Its an HP pavilion dv6. I can see that the webcam is turning on, but it shuts off immediately. Help?