Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Smart TV

Is there any script to detect if the site accessed starting this coming from a Smart TV?

I would like to detect whether a computer, tablet, mobile phone or TV. Anyone know how to do this?


2 Answers

Seeing as most smart TVs use the major browser projects (such as Mozilla, Chromium, Safari etc) as their web browser, you are not going to find much difference in their behavior if at all. Your only good solution is to rely on the courtesy of the browser to provide this information to you via the user-agent property of the header.

You can consult this list of smart TV user agents to engage at your detection strategy.

like image 167
Ben Barkay Avatar answered Nov 25 '25 11:11

Ben Barkay


Refer to BBC talframework http://fmtvp.github.io/tal/getting-started/introducing-tal.html

In this framework they are using detection method for the device, Once device is detected then js according to the framework is loaded

like image 33
abhi Avatar answered Nov 25 '25 11:11

abhi