colonizator1/tv-detector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 — returns true if the user agent matches any known TV signatures.
  • TvDetector::isAndroidTV(string $userAgent): bool — returns true if 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固