(Reuters) - Walt Disney Co DIS.N reported a steeper earnings decline than Wall Street expected on Tuesday as the company poured money into its ambitious plunge into streaming media and began folding in assets purchased from Twenty-First Century Fox.

Shares of Disney, which had risen 27% this year and hit an all-time high last week, dropped as much as 5% in after-hours trading to $135.

Excluding certain items, Disney earned $1.35 per share for the quarter that ended in June, below average analyst estimates of $1.75 per share, according to IBES data from Refinitiv.

Disney, the owner of ESPN, a movie studio and theme parks, is investing heavily in digital media platforms to challenge the dominance of Netflix Inc NFLX.O.

Its biggest digital bet, a family-friendly subscription service called Disney+, is scheduled to debut in November. Shows aimed at adults will be concentrated on Hulu, which Disney now controls.

The direct-to-consumer and international unit reported an operating loss of $553 million from April to June, wider than the $441 million loss analysts were expecting, and up from a $168 million loss from a year earlier. Costs piled up from consolidation of Hulu and spending on Disney+ and the ESPN+ streaming service, Disney said.

Future digital investments will lead to a roughly $900 million operating loss in the direct-to-consumer unit in the quarter that ends in September, the company said, compared with expectations of a $593 million loss.

Slideshow ( 4 images )

For the just-ended quarter, executives said Fox’s film studio performed worse than expected while the costs to broadcast cricket through Fox’s Star India were higher than anticipated.

“Some of the other misses seem to be related to the integration of Fox,” said analyst Jim Nail at Forrester. “I would speculate that they have decided to take all their lumps this quarter and put all this ‘bad’ news together, clearing the board for better results next quarter.”

Disney Chief Executive Bob Iger said the company was focused on integrating the Fox film and TV assets and using them with Disney’s businesses to move quickly into streaming video.

“Nothing is more important to us than getting this right,” Iger said. “We remain confident in our strategy and our ability to successfully execute it.”

Iger also said it would bundle its streaming services, charging $12.99 a month for Disney+, ESPN+ and ad-supported Hulu, starting in November.

At the theme parks unit, overall operating income rose 4% to $1.7 billion but declined at Disney’s U.S. parks. The company attributed the drop to expenses for a “Star Wars”-themed expansion at California’s Disneyland and lower attendance.

Media networks, which includes ESPN, the Disney Channels and FX, reported a 7% increase in operating income to $2.1 billion.

A blockbuster movie slate led by “Avengers: Endgame,” the highest-grossing movie of all time, helped boost revenue to $20.2 billion. That was short of the $21.5 billion that analysts expected.

“Endgame” boosted movie studio profit to $792 million, along with hits “Toy Story 4” and “Aladdin.”