Ad-supported streaming continues to be a boon for Roku: The streaming device maker solidly beat market expectations with its Q2 2018 earnings report Wednesday, surprising investors with the news that it was on the verge of profitability for the quarter.

During the quarter that ended on June 30, Roku generated revenue of $156.8 million, compared to $99.6 million during the same quarter last year. Net losses came in at $0.1 million compared to $13.38 million a year ago. This translates to losses of $0.0 per share.

Analysts had expected revenue of $141.48 million and losses of $0.15 per share. Investors responded by sending Roku’s share price up around 8% in after-hours trading.

However, the company also cautioned investors that its numbers for the quarter were helped by a one-time influx of $8.9 million the company had allocated for licensing fees, but didn’t actually have to pay.

Much of the revenue boost was attributable to the company’s platform business, which includes licensing fees as well as revenue from advertising running against videos shown to Roku users. Platform revenue grew 96% year-over-year, totaling $90.3 in Q2. Roku now makes 56% of its money with licensing and advertising, and the company’s GM of platform business Scott Rosenberg detailed during the company’s earnings call that about two-thirds of Roku’s platform revenue is coming from ads.

Roku ended the second quarter with 22 million active accounts, which collectively streamed 5.5 billion hours of content during the quarter. And Roku’s growing user base is becoming ever more valuable for the company: In Q2, each user was worth $16.60 to the company on average, compared to $11.22 a year ago.

“To continue to fuel ARPU growth, we are expanding our access to advertising inventory supply and expanding our audience reach both on and off our platform through free, ad-supported channels (aka apps) like The Roku Channel,” the company said in its shareholder letter.

Just moments before disclosing its Q2 2018 results, Roku announced that it was bringing its ad-supported Roku Channel to the web and mobile devices. Roku CEO Anthony Wood told Variety in an interview Wednesday afternoon that the company didn’t expect this new type of off-platform viewing to generate significant revenue in 2018, but he argued that it could also be a marketing vehicle for the company.

Roku continues to invest significantly into R&D, to the tune of $40.2 million for the quarter. Some of the company’s recent R&D investments were used to kick start Roku’s entry into the home audio space; Roku announced a licensing partnership with TCL for Roku sound bars earlier this year, and more recently unveiled its own speakers, which are meant to be operated in concert with a Roku TV.

Wood said Wednesday that these audio products likely won’t have a big impact on 2018 revenues either, but argued that the bet on home audio ultimately would help the company succeed in growing its smart TV market share. “We want to make the Roku TV platform even better,” he said.