Roku's (ROKU -0.40%) second-quarter earnings report reflects ongoing challenges with the slowdown in the advertising market, but there were plenty of bright spots. Active accounts grew 14% year over year, and the increase in total streaming hours on the platform grew to 19% year over year.  

While revenue growth is decelerating rapidly due to weakness in advertising, Roku still posted a respectable 28% increase in total revenue year over year. Should investors take that performance as a buy signal?

To answer that question, we need to look at how Roku is performing relative to the connected TV advertising market. This is a fast-growing market, so if Roku is gaining market share, investors could be looking at a great buying opportunity with the stock trading at rock-bottom prices.

Roku's long-term opportunity 

Roku's guidance calls for revenue to decelerate to just 3% in Q3. The gloomy outlook sent the stock to new lows following the earnings news, although it has since rebounded and is down 6% over the last month. But investors shouldn't put too much weight on next quarter's numbers. 

Roku is still where it needs to be to capitalize on a $26 billion connected TV advertising market, which is expected to grow 24% in 2022. It is already gaining market share in this exploding market. In the first half of 2022, Roku's platform revenue, including advertising, grew 32% year over year to $1.3 billion. 

Since 2017, connected TV advertising spending has grown from just $3.8 billion as traditional TV advertising shifts to streaming platforms. This market is expected to reach nearly $50 billion by 2027, so Roku's market-leading streaming platform stands to grow by leaps and bounds over the next decade.

A bar chart showing the connected TV ad market growth between 2017 and 2027.

Note: Forecasts from 2022 onward.

Don't let management's near-term guidance fool you. Roku has tremendous momentum simmering underneath the surface. It may just take a stronger economy and an ad-spending environment to get the stock moving higher. That may come sooner than later.

One of the silver linings of the recent earnings report was that streaming engagement for adult viewers between 18 to 49 exceeded the viewing time of legacy TV for the first time. 

If you're looking at this with a long-term mindset, you can almost see what's getting ready to happen. When the economy is stronger and advertisers are more willing to step up their investment on connected TV platforms, Roku could experience a massive acceleration in platform revenue. The upside for the stock could be quite large given Roku's historically low valuation.

At the stock's all-time high in early 2021, shares traded at over 30 times sales. That might have been a little too rich for most investors, but at a current price-to-sales (P/S) ratio of 3.8, Roku stock has never been cheaper.

ROKU PS Ratio Chart

ROKU PS Ratio data by YCharts

During Roku's Q2 earnings call, CEO Anthony Wood suggested that the weak economic environment could serve as the catalyst that encourages more companies to consider advertising on connected TV platforms like Roku's:  

[The current environment] reminds us of when advertisers paused spend during the 2008 recession, but it became a catalyst that accelerated the shift of ad spend from print publishing to digital. We believe a similar opportunity exists now for advertisers to accelerate their shift from legacy pay TV to TV streaming.

Wood cited one piece of evidence to back up the company's view. Recently, Roku surpassed the milestone of $1 billion in advertising commitments for the upcoming 2022 to 2023 TV season. That's another indicator that Roku could be a volcano waiting to erupt.

Contrary to what the stock's performance might lead you to believe, this isn't a fly-by-night company. Roku is the No. 1 TV streaming platform in the U.S. with 63 million active accounts. As Wood indicated, the near term will be painful, but the long-term shift from legacy TV to streaming is in Roku's favor.