Can you have a web browser in game that points to a youtube music video and play that in your game legally?

That’s mostly a question of YouTube policy. It may depend on the video, but note that games that feature commercial music usually pay big licensing fees to include they music in the game.

I want to place a computer in game that points to a youtube video that plays a music video, is this legal in a commercial product?

https://docs.unrealengine.com/latest/INT/Engine/UMG/UserGuide/WidgetTypeReference/WebBrowser/
There is a web browsing widget. I didnt know it existed until I seen it while packaging linux.

What? Are you serious? Do videoplayers pay rolalties for everyone playing someone’s music?

I’m serious that I can’t speak to whether YouTube permits in-game use of YouTube.

Like anything else legal is probably boils down to intent. If your intent is to run an invisible but listenable youtube audio only for background to your game to bypass having the music content locally, yeah, that’s pretty devious but also something YouTube would have issue with.
If you gave access to YouTube as a web page and didn’t block their ads, etc, I wouldn’t think they’d have any issue just like any other browser.
I say all of this with probably because 1) I am not a lawyer 2) I once heard a lawyer say to me that one great thing about the law is that just about any law can be interpreted in a different spirit. 3) Anyone in the US can be sued for anything.