The tech-heavy Nasdaq Composite has been the worst performing of the three major U.S. market indexes this year. That's not great news for investors who fancy the technology sector. However, it also means plenty of leaders in the space are now trading at much lower prices.

In other words, it's an excellent opportunity to buy low -- at least relatively speaking, since there is no way to tell whether equity markets have truly bottomed out yet. Need some inspiration? Here is one stock that has been pummeled over the past year but still has solid long-term prospects: Roku (ROKU 5.41%)

Roku's ugly quarterly update 

Roku recently released its second-quarter results, and to say that it failed to impress investors would be an understatement. The tech company reported a net loss of $112.3 million, compared to net income of $73.5 million in the year-ago period. Roku's bottom line was much worse than analysts had anticipated, one of the major factors leading to the stock's decline on the heels of its earnings release.

Meanwhile, the company's top-line growth rates have plummeted almost as much as its stock price over the past year.

ROKU Chart

Data by YCharts.

Roku's revenue increased 18% year over year to $764.4 million. Slower revenue growth combined with deeper net losses isn't a good sign for any company, and the are more troubles ahead. The macro headwinds primarily responsible for its second-quarter struggles are still very much present. Roku expects spending on ads to continue to suffer amid inflation and recession fears, among other factors.

That will further impact the company's revenue. In fairness, there were some good signs in the quarterly update. Streaming hours grew 19% year over year to 20.7 billion, while active accounts jumped 14% to 63.1 million. Meanwhile, Roku's average revenue per user came in at $44.10, 21% higher year over year.

It's too early to call it a day

It's not surprising economic headwinds are hurting Roku's business. When the economy tanks, both individuals and companies start reining in their spending and focus primarily on necessities. For Roku, that means fewer ad dollars flowing into its network, but these economic woes won't last forever.

Eventually, inflation will slow, supply chain issues will come under control, and recession fears will be a thing of the past -- even if it means we have to suffer through a recession for that to happen. On the other hand, there are long-term opportunities Roku is looking to tap into that will provide it with a runway for growth for many years to come. The switch to streaming is still ongoing, and it will continue.

Many have already cut the cord. Viewers prefer watching shows from a vast library on their own time and on any electronic device they wish, rather than the set television programs legacy companies offer. Furthermore, younger generations growing up with streaming will have even less interest in traditional cable going forward. That's why many cable companies have launched their own streaming services.

The network Roku provides through its operating system helps connect consumers to dozens of streaming services, including the most prominent ones. This platform is attractive to advertisers, who can target millions of potential customers based on their viewing habits and other important data.

Streaming hasn't completely taken over yet, not even in the U.S. And equally important, advertisers have been slow to switch their campaigns from legacy pay television to streaming platforms such as Roku's. As CEO Anthony Wood said during its second-quarter earnings call:

In the first half of this year, TV streaming passed the tipping point, where recent engagement for adults aged 18 to 49 exceeded that of legacy pay TV. However, marketers are expected to spend just 22% of their TV ad budget on streaming in 2022. The ultimate driver of our success is the continued shift of viewers to streaming around the world, and the closing gap between viewership and ad budgets.

The streaming tailwind will help Roku recover from its recent woes. Things might get worse before they get better, but the tech stock is still well positioned to deliver solid returns in the long run.