In the second quarter, preliminary data revealed that U.S. gross domestic product (GDP) decreased for the second successive quarter, suggesting the country is currently in a recession. The ongoing economic uncertainty caused by rising interest rates, the bear market, and 40-year-high inflation is causing businesses to tighten their purse strings. One of the first line items on the income statement to face cuts is often the advertising and marketing budget, a line that's easy to adjust in the short term.

Unfortunately, that's exactly how things have played out for Roku (ROKU -1.90%). The company released its second-quarter financial results after the market close on Thursday, and they were dismal. The combination of lower ad spending and the decelerating growth in streaming video have hit the stock hard, and it's down more than 80% from highs it reached last year.

That leads to the inevitable question: Is Roku stock a buy after its spectacular fall from grace? Here's what investors need to know.

The numbers tell a story

Roku's revenue of $764.4 million climbed 18% year over year, fueled by platform revenue, which grew 26%. Player revenue of $91.2 million declined 19%, the result of lower connected-TV and Roku player sales, which were caught up in the industrywide downdraft. As a result, Roku's profit swung to a loss, with a loss per share of $0.82.

To give those numbers context, analysts' consensus estimates were calling for revenue of $804 million and a loss per share of $0.71, so Roku missed both by a wide margin. 

Not all the news was bad. Roku continue to grow its viewer base, as active accounts of 63.1 million climbed 14% year over year, driving streaming hours up 19% to 20.7 billion.

The hidden gem in the report, and perhaps the most important nugget, is that Roku's average revenue per user (ARPU) climbed 21% to $44.10 -- its highest rate ever. This suggests that, even in the face of slowing growth, Roku is able to increase the value of each user. When account growth reaccelerates, it will help supercharge the company's revenue growth and boost profitability.

Management also said Roku continued to gain market share, stealing ad dollars from traditional linear television. In fact, a full 25% of all advertisers that are currently committed to advertising on Roku weren't even partners last year. 

What the future holds

Management didn't pull any punches with its outlook for the third quarter. Roku is guiding for total net revenue of $700 million, up just 3% year over year, resulting in a net loss of $190 million. The company also withdrew its full-year outlook, citing "the uncertainties and volatility in the macro environment." 

Management said there was a "significant slowdown in TV advertising spend due to the macro-economic environment, which pressured our platform revenue growth ... we expect these challenges to continue in the near term as economic concerns pressure markets worldwide." The company went on to say that consumer spending was also moderating, resulting in the sale of fewer Roku streaming devices and connected TVs. 

Is Roku stock a Buy?

Given all the uncertainty, should investors steer clear of Roku, or is the stock a buy? As with so many things, the answer won't be the same for every investor, but there are plenty of catalysts that could propel Roku stock higher in the months and years to come.

The global streaming video market was valued at more than $372 billion last year but is expected to grow more than fourfold, to $1.69 trillion by 2029. By providing gateway products -- namely, its namesake streaming devices and the Roku operating system (OS) for connected TVs -- the company is well-positioned to benefit from this secular trend. 

Furthermore, the Roku OS is the No. 1 selling smart-TV OS in the U.S. and No. 2 in Mexico, where 1 in 4 smart TVs sold was a Roku model. As a result, Roku is the No. 1 streaming platform in the U.S, Canada, and Mexico in terms of hours streamed. Using this success as a template, Roku is strategically entering a number of international markets using the same strategy.

With 63 million viewing households, all the major streaming services need to be on Roku's platform in order to reach their respective audiences. And finally, Roku stock is currently trading at roughly three times trailing-12-month sales -- its lowest valuation in years.

Streaming growth may have slowed, but that situation is likely temporary. Given Roku's dominant position in both the streaming device and connected-TV space, the large and growing market it serves, and its historically low valuation, I would argue that Roku stock is a buy for investors who plan to buy and hold for years -- if not decades.