Media-player technology developer Roku (ROKU 1.07%) reported second-quarter results on Wednesday, obliterating Wall Street's estimates across the board. the report wasn't absolutely perfect and bears found enough chinks in Roku's armor to drive the stock 6% lower over the next two days. But Roku delivered the goods on the most important metrics. This company is poised to deliver market-crushing returns in the long run, especially if you start your position at a temporary discount like the post-earnings drop you saw this week.

Let's have a look at Roku's second quarter by the numbers.

Hand pointing a remote control at a wall of TV sets, all showing different programs.

Image source: Getty Images.

The usual headline stats

Roku's second-quarter sales rose 81% year over year, landing at $645 million. Your average analyst would have settled for top-line sales near $619 million.

The company added 1.5 million active accounts in the second quarter, adding up to 55.1 million names. That's up 28% from 43 million active customers in the year-ago period.

The bottom line swung from a net loss of $0.35 to a net profit of $0.52 per share. Here, the Street was looking for a net profit of approximately $0.12 per share.

Digging deeper

Here's where things get really interesting.

Hardware revenues increased 1% to $113 million, while services and software licenses more than doubled their sales from $245 million to $532 million. The hardware-centric player division accounted for just 17% of Roku's total second-quarter revenues, down from 31% in the second quarter of 2020.

That's a fantastic trend because software and services are more profitable than the set-top boxes ever were, and this business can also scale up its sales at the drop of a hat. Selling another million software licenses or showing a million ad impressions requires very little capital investment, but cranking out a million hardware boxes can be a costly process indeed.

Hence, Roku's business model is leaning away from the low-margin business that got the company started, shifting over to the much more lucrative platform segment as we speak. The platform division generated $345 million of gross profits in the second quarter, which amounts to a 64,8% gross margin. On the player side, Roku burned $6.7 million instead at a negative gross margin.

Magician conjuring a hand holding several hundred-dollar bills from his magic top hat.

Image source: Getty Images.

What's next?

Extend these business trends over the long term, and you'll eventually see the player division fading into the background. Roku may divide its operations up in a different model someday soon, allowing investors to get a better view of media-player software licenses versus ad sales and other media services, with har4dware players being little more than an afterthought.

On the road to that restructuring, Roku's sales will continue to soar while profit margins grow wider. The resulting cash flows will probably be put to work right away, reinvested in stronger R&D and marketing programs -- which then should push the flywheels of financial growth a little bit harder every year.

It's a self-reinforcing virtuous cycle that is already turning Roku into a well-respected leader in the media-streaming industry. And the company's long-term growth story has only just begun. Buying Roku shares on the dips is a great idea, and the stock is trading 20% below last month's all-time highs right now.

I highly recommend picking up a couple of shares while the discount lasts, especially if you don't have any Roku stock in your portfolio yet. It's not too late to get started.