Roku (NASDAQ:ROKU) recently posted strong first quarter numbers that easily beat analyst estimates. However, the stock initially jumped after the news on May 10, and finished the day with a 2% decline. Roku has tumbled 30% for the year, but remains roughly 150% above its IPO price of $14.

Investors might be wondering if it's safe to finally buy this divisive stock. Let's take a closer look at its first quarter numbers to find out.

ESPN on a Roku set-top box.

Image source: Roku.

What Roku did right

Roku's revenue rose 36% annually to $136.6 million during the quarter, beating estimates by $9.5 million and marking an acceleration from its 28% growth in the fourth quarter.

Its Platform revenues rose 106% to $75.1 million, as its Player revenues dipped 3% to $61.5 million. Its Platform gross profit rose 90% to $53.4 million and its Player gross profit dropped 10% to $9.7 million. The company also claimed that a quarter of smart TVs sold across the U.S. were Roku TVs.

Those figures indicate that Roku is successfully pivoting away from its lower-growth, lower-margin streaming devices and toward its higher-growth, higher-margin software platform, which generates revenues from ads and content partnerships.

Recent catalysts for the Platform business include its ESPN+ partnership with Disney and the introduction of the Roku Channel on select Samsung Smart TVs.

A woman uses a smart TV.

Image source: Getty Images.

Roku's active accounts rose 47% annually to 20.8 million, its total streaming hours climbed 56% to 5.1 billion, and its average revenue per account soared 50% to $15.07.

On the bottom line, Roku's net loss narrowed from $8.7 million to $6.6 million, or $0.07 per share, which topped expectations by eight cents. Its adjusted EBITDA loss narrowed from $4.4 million to $0.8 million thanks to a reduction in operating expenses.

Roku's guidance for the second quarter for 36%-46% sales growth and an EBITDA loss between $7-$12 million matched analyst estimates. Meanwhile, its full year guidance for 34%-37% sales growth and EBITDA between -$10 million and $5 million topped expectations.

So why didn't the stock rally?

I've been cautious about Roku in previous quarters, since I wasn't sure that it could offset the declines in its Hardware unit with its Platform unit's growth.

But Roku clearly proved that it could do so with its first quarter numbers, so I was surprised that the stock didn't rally. I think two issues are holding Roku back: its valuation and concerns about Amazon (NASDAQ:AMZN).

Roku is still unprofitable, and trades at roughly five times its sales estimate for 2018. That valuation would be acceptable for a high-growth company with a clear runway ahead, but there's a chance that Amazon could torpedo Roku's growth with its new Fire TVs, which are pre-installed with Amazon's Fire OS and Alexa virtual assistant.

Best Buy (NYSE:BBY) recently partnered with Amazon to sell Fire TVs, which will be produced by its in-house Insignia brand and Toshiba, in its stores and website this summer. Best Buy will also become a Fire TV merchant on Amazon's website.

Best Buy's Insignia also produces Roku TVs. Best Buy plans to keep selling Roku TVs, but the appeal of Amazon's Prime ecosystem could hurt Roku. During the conference call, CEO Anthony Wood admitted that "Amazon and others" could "get some share" of smart TVs -- but asserted that Roku was still "the biggest" and "most well-positioned" in the market.

So is it safe to buy Roku?

I'm still torn about Roku. On the one hand, its fundamentals are strong, and its plans to pivot from hardware to software are paying off. On the other hand, Roku faces much larger competitors in the smart TV market as licensed operating systems like Amazon's Fire OS gain ground.

I'm not confident that Roku can withstand a sustained assault from Amazon, which can leverage its Echo devices and Prime ecosystem to hurt Roku. Therefore, I'd stay away from Roku until I see how it fares against Amazon's upcoming assault this summer.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Leo Sun owns shares of Amazon and Walt Disney. The Motley Fool owns shares of and recommends Amazon and Walt Disney. The Motley Fool has a disclosure policy.