Whenever I see or hear about someone playing a game, watching videos, reading the news or whatever is not job related, I beg to ask the question what's the deliverable they are working on and why do they have nothing to do? These two points being the responsibility of their PM or team lead.
If they produce what is expected of them, leave them alone, peer pressure will take care of their behaviour if it is going to be a problem.
If they do not produce what is expected of them, then there is no point in tackling the game playing. What needs to be tackled is why they do not produce what is required from them. Are they waiting on someone, is there a blocking issue that stops them, are they themselves demotivated by their team or boss?
Lastly, everybody needs some form of break during the work day, and some. Some of those breaks involve interaction with other people, sometimes online if that is possible. Personally, I use my phone to get in touch with people who matter to me, and in. In a previous job I have put some time aside for playing board games with workmates, and even occasionally with our CEO. It all depends on context, frequency and whether of course you deliver the goods.