colonizator1/tv-detector
最新稳定版本:v1.0.3
Composer 安装命令:
composer require colonizator1/tv-detector
包简介
Lightweight TV user-agent detector.
README 文档
README
Lightweight TV user-agent detector extracted from matomo/device-detector brand-level regexes. Uses a single preg_match() instead of the full DeviceDetector pipeline.
Installation
composer require colonizator1/tv-detector
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use TvDetector\TvDetector; $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? ''; if (TvDetector::isAndroidTV($userAgent)) { // Handle Android TV specifics } if (TvDetector::isTV($userAgent)) { // Handle generic TV }
API
TvDetector::isTV(string $userAgent): bool— returnstrueif the user agent matches any known TV signatures.TvDetector::isAndroidTV(string $userAgent): bool— returnstrueif the user agent looks like Android TV (including OEM skins).
Notes
- Patterns are derived from the Matomo DeviceDetector regex sets (televisions and shell TV), limited to brand-level detection.
- Empty user agents return
false.
License
MIT
统计信息
- 总下载量: 60
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-30