Barack Obama has released a video to draw attention to pressures facing gay teenagers, lending his weight to a campaign that has attracted more than 2,000 video contributions and 10m views on YouTube.

The campaign, prompted by a spate of gay American teenagers killing themselves in recent weeks, has also received the backing of the US secretary of state, Hillary Clinton, who has posted her own two-minute video.

In his video, Obama draws parallels with his own upbringing.

"I don't know what it's like to be picked on for being gay. But I do know what it's like to grow up feeling that sometimes you don't belong. "It's tough," he says. "When you're teased or bullied it can seem like somehow you brought it on yourself … With time you're going to see that your differences are a source of pride, a source of strength."

The video comes at a sensitive time for the White House as it challenges a judge's decision to halt the US military's "don't ask, don't tell" policy regarding gay servicemen and women. A government appeal of that decision was granted by a court this week, and the policy effectively remains in place.

But with the midterm elections less than two weeks away, and the Democrats facing significant losses, the administration needs to appease its liberal base and defuse anger over what some see as a betrayal of Obama's presidential election pledge to remove the restriction.

His video was welcomed by campaigners on the issue.Charles Robbins, executive director of the Trevor Project, a 24-hour helpline for gay youths at risk. He said: "I'm pleased that the president has spoken directly to youths, letting them know that they are not alone, that they didn't do anything wrong and don't deserve to be bullied. These are powerful words coming from the leader of the free world."

Posted on the White House website and linked to the It Gets Better Project, the video was launched by the activist and writer Dan Savage last month. He was moved to action after reading about the deaths of 15-year-olds Justin Aaberg, of Minnesota, and Billy Lucas, of Indiana. His initial reaction, which he wrote about in his blog, was to wish he had been able to talk to the boys to help them. But as an activist, he had found it impossible to gain access to schools to address children about sexuality and bullying.

Then Savage realised he did not need permission, that he could sidestep education authorities by creating a website where people could share their experiences. On 21 September, he and his partner, Terry, posted the first It Gets Better Project video, an eight-minute segment in which they revisit the bullying they were subjected to at school. By the end of that week, 200 videos had been posted from around the world. There are now plans for a Spanish-language site.

The videos feature diverse figures from politicians and pop stars to celebrities, comedians, and an array of people that only the internet could bring together. There is even a schmaltzy musical number titled It Gets Better, belted out by the cast members of several Broadway shows. If that fails appeal, how about a cartoon in which Lizzy the Lezzy asserts: "I'm here to tell you not to be so silly. There's absolutely no reason to kill yourself."

But the most affecting videos come from the public. "I received threats to my wellbeing, my car was vandalised," says one poster, who identifies herself as Jennie. "I never felt safe after elementary school … I turned to self-injury … During my high-school career I attempted suicide twice."

Savage said yesterday: "I think we've reached a meaningful tipping point culturally. Obama made a video and took sides with all sorts of gay figures. I think it's very powerful. Obama is in a position to do more than offer hope, he can bring change. Now all we need is the Queen to come out and say something."

One of the most viewed videos is a 12-minute speech by Joel Burns, a Texas councillor, who tells a council meeting about the suicides his own experiences as a young homosexual and the lack of support and intervention in schools.

"One day, when I was in the ninth grade I was cornered by some older kids who roughed me up. They said that I was a faggot, and that I should die and go to hell where I belonged."