Obama is as gay as he is black. For a supposedly straight person, his passion for the "rights" of only 2% of an irrelevant segment of the population is odd let alone unprecedented.
He has brought up gay "rights" during university commencement speeches, spoke of gay rights during speeches in Germany and Kenya, spoke of gay rights in his presidential inauguration speech.
He never flip flopped his view on marriage...in 2008 his claim supporting traditional marriage was a lie. The idea of gay marriage then would have made him less electable.
His gay record timeline his first 4 years...
https://my.barackobama.com/page/share/progress-for-lgbt-americans