In this April 30, 2014, file photo, John Blackburn, left, and John Vignocchi speak at the Disney Infinity 2.0 launch held at Pacific Theatres Cinerama Dome in the Hollywood section of Los Angeles. Disney said Tuesday, May 10, 2016, that it is shutting down its Disney Infinity line of video games, saying the changing market was too risky, and booked a $147 million charge mostly for unsold inventory. (Photo by Katy Winn/Invision/AP, File)

Disney said Tuesday it is shutting down its Disney Infinity line of video games, saying the changing market is too risky.

The company booked a $147 million charge, mostly for unsold inventory. It also laid off about 300 employees, most of them based in Salt Lake City at Avalanche Software, a game studio Disney bought in 2005.

CEO Bob Iger told analysts the risks "caught up with us." Although the unit did well—bringing its interactive division into profitability in recent years—Disney determined it was better to manage the risks by licensing characters rather than developing video games from scratch, he said.

"That business is a changing business, and we did not have enough confidence in the business in terms of it being stable enough to stay in it," Iger said.

Disney Infinity, a platform that brought characters from its "Pirates of the Caribbean" into the same digital sandbox as those from "Cars" and "Frozen," was launched in 2013 as a way to jump on the "toys to life" bandwagon made popular by the game "Skylanders." Real-world action figures were placed on pads and meant to activate in the world.

When Infinity launched in August 2013, it helped Disney pull its Interactive business to profitability after years of losses, and it was a precursor to the Playmation line of smart, connected toys Disney launched last year. But diminishing sales of Infinity hurt the consumer products unit that was merged with the interactive division last summer.

The high cost of making Infinity came in stark contrast to "Star Wars Battlefront," a hugely successful game in which Disney licensed its characters and stories to Electronic Arts. That deal gave its consumer products segment a big jolt in the previous quarter through December.

Infinity's lackluster results, conversely, contributed to Disney missing Wall Street forecasts in the latest quarter through March. It posted adjusted earnings of $1.36 per share, falling below the $1.40 expected by analysts surveyed by Zacks Investment Research.

The entertainment company posted revenue of $12.97 billion in the period, also falling short of Street forecasts. Six analysts surveyed by Zacks expected $13.26 billion.

Shares in Walt Disney Co., which is based in Burbank, California, tumbled 5.6 percent to $100.60 in after-hours trading after the results were released, taking them into negative territory for the year.