thelia / video-manager
Video url handling library
Installs: 833
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/thelia/video-manager
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: ~4.1
This package is auto-updated.
Last update: 2025-10-15 00:48:56 UTC
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