It uses an embed player, like how IMDb or any website uses it. When I added YouTube videos to my website, I observed that ads never show there, so I made it and added a sponsor block too. Now, I can watch videos on any device or share links without anyone installing anything.