thelia/video-manager
最新稳定版本:1.0.0
Composer 安装命令:
composer require thelia/video-manager
包简介
Video url handling library
README 文档
README
Thelia video manager is PHP >=5.4 library that reads an url and translate it to a usable video player or embed link.
- Installation
You can install Thelia video manager with composer:
$ composer require thelia/video-manager ~1.0
- Usage
Use Thelia\VideoManger\VideoManger to resolve your url:
<?php include "vendor/autoload.php"; use Thelia\VideoManager\VideoManager; $resolver = new VideoManager(); $videoUrl = $resolver->resolve("https://www.youtube.com/watch?v=7GiOIRc-8Q0"); if (null !== $videoUrl) { echo $videoUrl->getVideoPlayerWidget() . "\n"; } $videoUrl = $resolver->resolve("http://www.dailymotion.com/video/x25cki_hello_world"); if (null !== $videoUrl) { echo $videoUrl->getVideoPlayerWidget() . "\n"; } $videoUrl = $resolver->resolve("http://vimeo.com/115794083"); if (null !== $videoUrl) { echo $videoUrl->getVideoPlayerWidget() . "\n"; }
Thelia\VideoManger\VideoManger::resolve returns a Thelia\VideoManger\VideoUrl object.
- Add your own provider
If you want to use another video service than those already available, you can add yours with the
Thelia\VideoManger\ProviderBag::add method.
It must implement Thelia\VideoManger\Provider\ProviderInterface, but there is an abstract class that has some
methods to help you: Thelia\VideoManger\Provider\AbstractProvider
统计信息
- 总下载量: 848
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2015-01-26