mascame/video-checker
Composer 安装命令:
composer require mascame/video-checker
包简介
Check if a video is available online.
README 文档
README
Check if a video is available online.
Installation
Require this package in your composer.json and run composer update:
"mascame/video-checker": "2.*"
Usage
Just use $provider->check(videoId) with the provider you want
$youtubeProvider = new Mascame\VideoChecker\YoutubeProvider(); var_dump($youtubeProvider->check('C7OfO6r_5m0')); // true var_dump($youtubeProvider->check('CWO3Tuo35-o')); // false // Check if a video is disponible with API $youtubeProviderWithAPI = new Mascame\VideoChecker\YoutubeProvider('MY_API_KEY'); var_dump($youtubeProviderWithAPI->check('GOHXRe9o_Ls')); //false // Check if a video is disponible on a certain country var_dump($youtubeProviderWithAPI->check('GOHXRe9o_Ls', 'ES')); // false var_dump($youtubeProviderWithAPI->check('CWO3Tuo35-o', 'IT')); // true // As array (youtube has an API limit of 50 ids per call) var_dump($youtubeProviderWithAPI->check(['CWO3Tuo35-o', 'GOHXRe9o_Ls'], 'ES')); // ['CWO3Tuo35-o' => true, 'GOHXRe9o_Ls' => false] $vimeoProvider = new Mascame\VideoChecker\VimeoProvider(); var_dump($vimeoProvider->check('31161781')); // true var_dump($vimeoProvider->check('34134308a')); // false $dailymotionProvider = new Mascame\VideoChecker\DailymotionProvider(); var_dump($dailymotionProvider->check('x38rpxc')); // true var_dump($dailymotionProvider->check('x38rpxc3232')); // false // As array var_dump($dailymotionProvider->check(['x38rpxc', 'x38rpxc3232'])); // ['x38rpxc' => true, 'x38rpxc3232' => false]
Running tests
Install composer dependencies in development mode
composer update --dev
vendor/bin/phpunit tests/TestVideoChecker.php
Changelog
2.3
- Youtube Provider: Throw exception if API call fails or has errors (to avoid false negatives)
2.2
- Fixes stored Ids when was not in API response items
- Youtube Provider: get total API calls
2.1
- Allows array as parameter in 'check' method (output will be an array ['video-id' => bool, 'video-id2' => bool])
- Youtube Provider: Using ids parameter as array will avoid unneeded API calls (and dont waste quota)
2.0
- Allow Youtube API check without country specified
- Simplified API
- Updated tests
1.2
- Added API key injection via constructor for YoutubeProvider
1.1
- Added checkByCountry for YoutubeProvider
1.0
- Added Youtube, Vimeo & Dailymotion providers
Support
If you want to give your opinion, you can send me an email, comment the project directly (if you want to contribute with information or resources) or fork the project and make a pull request.
Also I will be grateful if you want to make a donation, this project hasn't got a death date and it wants to be improved constantly:
License
MIT
mascame/video-checker 适用场景与选型建议
mascame/video-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.68k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「video check」 「online video checker」 「youtube checker」 「vimeo checker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mascame/video-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mascame/video-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mascame/video-checker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony bundle for chameleon-system/sanitycheck
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
SoftWax Health Check Bundle for Symfony framework
The yii2-videojs-widget is a Yii 2 wrapper for the [video.js](http://www.videojs.com/). A JavaScript and CSS library that makes it easier to work with and build on HTML5 video. This is also known as an HTML5 Video Player.
Check for holidays - localeaware
统计信息
- 总下载量: 4.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-08