NEW YORK — There may have been enough aerosol spray to burn off the rest of our ozone layer, but Wednesday’s ambitious live version of the musical “Hairspray” on NBC was worth the environmental damage. It was light and fun and soon had you stuck.

Fittingly for a musical about pushing the boundaries, this was not a safe telecast in any way. It was shot with many outside scenes and with complex moving parts. Actors dodged real cars and buses, they dodged real dodge balls and some dancers dodged other dancers doing somersaults.

“This is America. You have to think big to be big,” one character says in the show, and this broadcast thought mighty big. There was a town riot, real rain, mechanized rats, swooping cameras, a real audience and golf carts racing between scenes.

Liberation was the theme — musical, racial and personal — in a story set in Baltimore 1962 and led by the pleasingly plump Tracy Turnblad. She lives to dance on “The Corny Collins Show,” Baltimore’s version of “American Bandstand.” She also wanted to integrate its all-white environs, and, along the way, be accepted for her full-figured self. All this was enlivened by a winning score by Tony Award winners Marc Shaiman and Scott Wittman.

Based on filmmaker John Waters’ subversive homage to his youth in early 1960s Baltimore, the telecast from NBC’s backlot in Universal City, California, was frantic and sugary and plagued by small technical glitches early, but smoothed out and ended with a happy bang. There even was time in the three-hour show for Jennifer Hudson and Ariana Grande to duet.

Harvey Fierstein provided a new teleplay and seized back the padded dress of Tracy’s mom. He had played the role on Broadway, taking it from Divine in the original film, but lost it to John Travolta in a 2007 film remake. On Wednesday, Fierstein was at his reliable best, particularly when he uttered the line “Hold mommy’s waffles” in his famous baritone.

Nice touches included getting two former Tracys — Ricki Lake from the movie and Marissa Jaret Winokur from Broadway — to make cameo appearances. Dove Cameron, from Disney’s “Liv and Maddie,” was a great mean girl and Ephraim Sykes was an ultra-smooth Seaweed. Derek McLane’s great ’60s-inspired sets also nicely nodded to past productions (“Waters Plumbing” read one store sign).

These live telecasts have a knack for uncovering fresh talent and that was again the case with Maddie Baillio, a college student plucked from more than 1,300 hopefuls to play the plus-sized protagonist. Baillio looked relaxed as Tracy and did herself proud alongside a glittery cast.

“Hairspray Live!” had one special trick up its sleeve — but this pyrotechnic was very human. Just when it seemed that the show would evaporate into a cloud of corny bubbles, the glorious Jennifer Hudson would arrive and produce the soulful gravity that the show needed. (Her “I Know Where I’ve Been” was simply jaw-dropping).

TV director Alex Rudzinski and stage director Kenny Leon teamed up well with the complex group numbers “Mama, I’m a Big Girl Now” and “Without Love.” Darren Criss played a high-energy host and commentator, while Sean Hayes, Andrea Martin and Rosie O’Donnell all made the most of their small roles.

Corporate America also chose to get in on the fun, with Toyota, Reddi-wip and Oreo all paying for live commercials and product placements during the show. (Things got a little smelly when Grande also got to shill her perfume.) Pretty much every musical on Broadway wisely bought commercials, too.

During some ad breaks, NBC showed a live backstage feed from the musical on a split screen with ads. There you could see Grande popping bubblegum, extras practicing their twirls and a whole lot of stressed-out camera operators.

They didn’t need to worry. They had seasoned pros. Kristin Chenoweth twirled a baton and killed every scene she was in, Martin Short was perfect as Edna’s adoring husband, and Jerry Mitchell (“Kinky Boots,” ”On Your Feet!”) choreographed infectious numbers.

Derek Hough as Corny Collins was Ken doll flawless, even gamely dunking an Oreo cookie into milk and popping it into his mouth after a big dance number. (Though, we’re not sure why Oreo needed to follow up Hough’s live Oreo endorsement with another of its cookie commercials. Isn’t that double dipping?)

The show let NBC further its grip on live musicals on TV following its “The Sound of Music Live!” ”Peter Pan Live!” and “The Wiz Live!” Earlier this year, Fox entered the market with “Grease: Live” and the pre-taped “Rocky Horror Picture Show.”

It felt like the creators of Wednesday’s telecast used all the tricks that worked from previous shows and added more complexity and risk. What’s next? Real helicopters? Underwater dance breaks?

Why not? As we learned Wednesday: You can’t stop the beat.

___

Mark Kennedy is at https://twitter.com/KennedyTwits

Mark Kennedy, The Associated Press