A young man and a teenager are charged in connection with a YouTube video showing an attack on a homeless man in New Jersey, police said.