For the most part, Tom Daley’s YouTube videos don’t stray too far from a lighthearted and upbeat tone. It’s part of what has made him such a charismatic camera presence — the kind of athlete who can make 15 shirtless minutes of sampling Japanese candy a must-watch.

But as host of the new BBC documentary “Tom Daley: Illegal To Be Me,” Daley gets a chance to show his fans a different side of himself. In taking on the weighty issue of legalized homophobia within dozens of Commonwealth countries, the openly gay Olympic diver proves that he can give a serious topic the kind of thoughtful and weighty treatment it deserves.

It’s quite a long way from walking down Hollywood Boulevard as Kermit the Frog. But it’s another step toward Daley’s fuller embrace of his role as athlete-activist on behalf the LGBTQ community.

“Illegal To Be Me” is an important program because it presents a stark and honest look at the depths of persecution that numerous LGBTQ athletes face in countries like Pakistan, Nigeria and Jamaica.

Six athletes and activists from “Illegal To Be Me” carried the Pride flag as Daley ran in with the Queen’s Baton during the opening ceremony for the Commonwealth Games in July.

For example, while Daley travels to Pakistan and manages to locate and communicate with several LGBTQ athletes, all of them are forced to hide their identities in one way or another for fear of their true identities being found out. And to a person, they offer very little in the way of hope or optimism that conditions in their country will improve anytime soon.

It’s a bleak sequence and at this point, the documentary could have descended into a nihilistic exercise in relentless hopelessness — something like what would happen if Werner Herzog ran ESPN. To be sure, there are many stories and some shocking footage throughout the film’s hour-long duration of athletes and public figures facing deeply disturbing homophobic abuse.

There are also scenes where Daley questions whether he should be proud of his Commonwealth Games medals and candid confessionals during which he recalls periods of depression and self-loathing as a closeted gay child.

What ends up interrupting this bleakness is Daley’s consistent refrain asking what can be done to improve these athletes’ lot in life. And what makes this part of the documentary especially interesting is that it provides an opportunity to watch the evolution of Daley’s viewpoint as to how to respond to Commonwealth countries that outlaw homosexuality.

For most of the past year, Daley has been vocal about his call for sporting organizations to ban nations with such laws on the books. In the past, he’s advocated for the Olympics to ban countries with death penalties for being gay. Echoing this at the start of the film, he asserts that the Commonwealth Games should consider preventing countries with anti-gay laws from hosting the event.

But while speaking to LGBTQ athletes in person, Daley learns firsthand that they don’t believe such a punitive punishment will help their situation. As one of the anonymous Pakistani athletes informs him, the rulers of their country wouldn’t be fazed by being forbidden from hosting the Games and such an action wouldn’t change anything for those who have to live there.

Instead, what stands out is that these athletes believe they can best be helped by the Commonwealth Games showing a genuine offering of support for all LGBTQ athletes and how many of them specifically request that the Pride flag be flown during the Games. To Daley’s credit, he makes a genuine effort to listen to what they have to say and soon realizes that bringing the rainbow flag into the Birmingham Games will be provide more hope than any ban.

Daley’s LGBTQ activism helped lead to his being named an Officer of the Order of the British Empire this past July.

While we in the U.S. are privileged to see so many Pride Nights in sports, we’re also sometimes quick to be skeptical about teams using Pride to market to our community. We often wonder if such promotions are just rainbow washing in disguise — sometimes justifiably so.

But as Daley’s documentary demonstrates, simply flying the Pride flag during the Commonwealth game represents a rare beacon of hope for so many LGBTQ athletes living under oppressive regimes. In this particular sports context, the rainbow banner represents something far deeper than a promotion — it’s about human rights.

So when Daley invited six activists and athletes that he met during the filming to carry Pride flags as he brought The Queen’s Baton into the Opening Ceremony, it was his way of telling all the athletes he encountered that what they had to say mattered.

While “Illegal To Be Me” is currently only available to stream in Britain, hopefully the BBC will give it a broader distribution soon. It’s a raw and honest portrayal of what it means to be LGBTQ in many countries that make living as your true self a crime.

It’s also a deeper portrait of Daley’s activism than anything we’ve ever seen before. In perhaps the documentary’s most hopeful moments, it also shows that Serious Tom Daley can get the job done.