Extract video/music information from any URL and render HTML
TubeLink is a PHP library to extract identifier from any URL of video / music / ..., (*1)
For each video-sharing website of the following list, a Service class can identify a supported URL and extract the video ID., (*2)
The recommended way to install TubeLink is through composer., (*3)
Just create a composer.json
file for your project:, (*4)
``` json { "require": { "grom/tube-link": "dev-master" } }, (*5)
And run these two commands to install it: ``` bash $ wget http://getcomposer.org/composer.phar $ php composer.phar install
Now you can add the autoloader, and you will have access to the library:, (*6)
``` php require 'vendor/autoload.php';, (*7)
If you don't use neither **Composer** nor a _ClassLoader_ in your application, just require the provided autoloader: ``` php require_once 'src/autoload.php';
You're done., (*8)
``` php use TubeLink\TubeLink;, (*9)
$url = 'http://youtu.be/kffacxfA7G4';, (*10)
$parser = new TubeLink(); $parser->registerService(new \TubeLink\Service\Youtube());, (*11)
$tube = $parser->parse($url);, (*12)
// Shows the embedded video HTML echo $tube->render();, (*13)
// Return the thumbnail echo $tube->thumbnail(); ```, (*14)
This feature is only available for these services:, (*15)