Google has been doing that for a long time. For example, many years ago it showed a warning about an unsupported browser if you tried to visit Google Docs using Opera. Now it is using user-agent to choose Youtube UI version (if you are unlucky to use a modern browser, you will get that bright whitened UI with huge margins).