SAN DIEGO — Children used to gravitate toward the Rokenbok display at mom-and-pop stores to get their hands on the toy maker’s monorail sets, robots and battery-powered dump trucks.

But as big retailers like Wal-Mart and Target drove many of those specialty stores out of business several years ago, the San Diego-area toy brand struggled to give shoppers a close look at its pricey play sets, which can cost hundreds of dollars.

That’s when it turned to YouTube. The privately owned business started shooting two- to three-minute stop-animation videos of its toys in action.

The clips show Rokenbok’s small Lego-like figures launching a rocket ship, fending off a robot invasion and being eaten by a Tyrannosaurus rex. Views have climbed into the millions and sales quickly grew 25 percent.

“We’re not a mass-market toy,” said Caitlin Bigelow, Rokenbok’s director of marketing who also directs and scripts the company’s YouTube videos. “The great thing about YouTube is we could target our niche audience. We discovered this whole subculture of kids who liked watching things like trash truck videos.”

Not every toy maker can be like Walt Disney Co., a behemoth that pipes original content onto its own cable network while releasing blockbuster movies to hordes of adoring fans.

For others, there’s YouTube. The Google-owned video platform has become an increasingly powerful tool for toy brands seeking to reach kids in an age when Saturday morning cartoons are a relic of a bygone era and mobile devices are quickly replacing televisions as the primary source of entertainment.

“YouTube especially benefits small and midsize companies that may not have the money to create full animated series,” said Jim Silver, editor in chief of toy review website TTPM. “It’s cost effective and it gets seen by kids.”

That’s not to say some bigger names haven’t benefited too.

Silver said YouTube is credited with helping propel Lego’s massive resurgence in the last decade after fans started making live-action videos with the toys re-enacting cultural touchstones like Michael Jackson’s “Beat It” music video and Indiana Jones’ “Raiders of the Lost Ark.”

Today, toy giants Lego, Mattel and Hasbro all run YouTube channels with varying degrees of original digital content. The popular series “Barbie: Life in the Dreamhouse” leaned heavily on YouTube, as did an animated series for the dolls in “Monster High” – both Mattel properties. Even Toys R Us is getting into the action with YouTube videos introducing the hottest toys.

“Toy makers want to go where the eyeballs are and a generation ago that was Saturday morning cartoons,” said Jason Moser, a toy analyst at the Motley Fool. “Today though, that dynamic has shifted with not only the move away from linear television but also the very redefining of what a TV is with the proliferation of mobile devices.”

Meanwhile, at Rokenbok’s headquarters, about 20 miles north of downtown San Diego, staff churn out up to 40 YouTube videos a year.

“We’re not Lego or Mattel,” said Bigelow, the marketing director. “We’re also not as big as people think we are. We’re a small company with a big Web presence.”