How does a phone or something vibrate?

Is it some kind of rotating motor or a weight that oscillates back and forth? Is there a benefit to using one over the other?

The ones I’ve seen, there’s a little rotating motor with an off-centre weight on its shaft. Youtube link.

There’s a little motor that spins a lopsided weight.

http://www.surplustraders.net/a/mf918.gif