What happened

Shares of Roku (ROKU 0.15%) cratered on Friday, falling by as much as 27.2%. As of 10:56 a.m. ET, the stock was still down 24.21%.

The catalyst that sent the streaming video pioneer into a tailspin was its second-quarter report, which was far worse than anyone expected as macroeconomic conditions dragged on its business.

So what

Total net revenue grew 18% year over year to $764 million, but the results of its segments were mixed. Sales from its platform segment -- which consists of digital advertising, The Roku Channel, and licensing revenue from its smart-TV operating system -- grew 26% year over year. At the same time, player revenue declined 19%, bogged down by supply chain disruptions and a slowdown in consumer spending. As a result, the company swung from a profit to a net loss of $112 million, or $0.82 per share.

To put those results in context, analysts' consensus estimates were calling for revenue of $804 million and a loss per share of $0.71. Roku even missed its own expectations, as management had guided for net revenue of $805 million and a net loss of $109 million, so the company whiffed on both.

Perhaps most discouraging was management's commentary, which suggested things will get worse before they get better. In its letter to shareholders, Roku noted that there was a "significant slowdown in TV advertising spend due to the macro-economic environment." To make matters worse, the company saw a slowdown in consumer discretionary spending last quarter, and management "expect[s] these challenges to continue in the near term."

The news wasn't all bad. The company continued its unbroken streak of increasing its average revenue per user, which grew 21% year over year to $44.10, and it continued to gain market share.

Now what

The company's outlook was fairly dismal. For the third quarter, Roku is guiding for revenue of $700 million, an increase of 3% year over year, and a deepening net loss of $190 million. Management also pulled its full-year guidance, citing the uncertain macro environment.

There are no doubt challenges ahead for the company, but Roku's industry-leading position and its massive installed base of viewers should help insulate it from significant damage, and business will rebound once the economy improves. Those who buy now and hold on will look back on the purchase as a smart move in five years.