Roku (ROKU 1.81%) is not having a good year in 2022. The company is grappling with the indirect consequences of the coronavirus pandemic, including supply chain disruptions, soaring inflation, and evolving consumer behavior. 

These forces work together, bringing down Roku's sales and profits. As a result, Roku's stock is down 85% off its highs. That said, Roku's headwinds are primarily short term. Meanwhile, the widespread consumer shift to streaming content instead of watching through a traditional cable connection is a tailwind. Are Roku's long-term prospects strong enough to overpower the near-term headwinds and make Roku stock a buy? Let's answer that question below.

Roku's absorbing higher costs 

The coronavirus pandemic was initially positive for Roku's business. People were spending most of their time indoors, and streaming content became one of the most popular pastimes worldwide. Roku's revenue jumped by 57.5% in 2020 and then 55.5% in 2021. However, the secondary consequences of the outbreak soon became a headwind, as inflation boosted costs.

ROKU Revenue (Quarterly) Chart

ROKU Revenue (Quarterly) data by YCharts

Businesses competed against each other for the available scarce resources. The bidding wars increased costs that most companies passed along to consumers. Roku's management has taken a different route. Instead of raising prices on their products due to rising inflation, Roku is absorbing the higher costs. Roku's gross profit margin in its player segment has been negative for five consecutive quarters. Indeed, the losses are accelerating.

To make matters worse, rising inflation is pinching consumer budgets. After paying higher prices for necessities like food, rent, and gas, people have less money left over for discretionary purchases. The challenging macroeconomic scenario has caused advertisers to reduce spending. Management attributed these conditions to Roku's slowing revenue-growth expectations. 

Millions are cutting the cord on cable

Despite those near-term headwinds, Roku has excellent long-term prospects. The company sells players that connect TVs to its platform, where folks can stream content. Additionally, Roku partners with TV manufacturers to make its platform the operating system. In the U.S., Roku is the No. 1 smart TV operating system and No. 2 in Mexico.

Moreover, according to eMarketer, traditional pay TV households in the U.S. are expected to decline from 68.5 million in 2022 to 57.2 million in 2026. These households will likely shift to streaming content, and since Roku is the No. 1 operating system in the U.S., they could capture the bulk of the viewing time.

An inexpensive valuation 

ROKU PS Ratio Chart

ROKU PS Ratio data by YCharts

The dramatic 85% fall in Roku's stock price has made it inexpensive. The company is trading at a price-to-sales ratio of 3.2, which is the cheapest investors have been able to buy Roku stock in the last five years, according to this metric. 

Given Roku's solid long-term prospects and relatively inexpensive valuation, Roku stock is a buy right now.