Play to the gallery

To perform in a manner that will get the strong approval of the audience.

The politician always plays to the gallery and tells his supporters what they want to hear.