Shares of content streaming device providers Roku (ROKU - Get Report) and Trade Desk (TTD - Get Report) both gained on Friday after being upgraded by RBC Capital to outperform from sector perform in the wake of what analyst Mark Mahaney calls a "material" pullback in both companies' shares and strong upside for content streaming.

"In our July 1st downgrade, we wrote that we would become constructive again on a material stock pullback; the shares have had large swings since then," RBC's Capital Mahaney wrote in a research note.

With Roku down some 32% from its record high last month and Trade Desk down 33%, Mahaney said both companies are now attractive again from a valuation standpoint, and both offer some of the best ways to play streaming, which he called "one of the strongest trends" in the internet stock group.

 

Roku, in particular, has been on a downtrend since early September amid a flurry of analyst downgrades over what has been viewed as stiff competition from other streaming content device makers.

The stock got a mild boost earlier this week after it was announced two Walmart-branded Roku products would be hitting the retailers' shelves in the coming weeks as part of an exclusive deal with Walmart (WMT - Get Report) .

Shares of Roku were up 5.56%, or $6.46 a share, at $122.59 in morning trading o. Shares of Trade Desk were up 3.2%, or $5.95 a share, at $191.60.