| Recommend this page to a friend! | 
|  Download | 
| Info | Example |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2025-05-08 (Less than 1 hour ago)  | Not enough user ratings | Total: 314 | All time:  7,273 This week: 59  | |||||
| Version | License | PHP version | Categories | |||
| phata-widgetfy 1.18 | GNU Lesser Genera... | 5.3 | HTML, PHP 5, Content management, Video | 
| Description | Author | ||||||||||||||||||||||
| This package can generate HTML to embed video content of given URL. | 
 | ||||||||||||||||||||||
| 
<?php | 
[![Travis Test Status][ci-badge]][ci-branches-url] [![stable-version-badge]][packagist-url] [![license-badge]][packagist-url] [![download-badge]][packagist-url]
[stable-version-badge]: https://poser.pugx.org/phata/widgetfy/v/stable [license-badge]: https://poser.pugx.org/phata/widgetfy/license [download-badge]: https://poser.pugx.org/phata/widgetfy/downloads [packagist-url]: https://packagist.org/packages/phata/widgetfy
<span style="color:red">!!Notice!!<span>: Development of Widgetfy has migrated to GitLab.com.
Widgetfy is a PHP library to translate URLs of video sites into the embed / widget.
First, install [composer] to your development platform.
Then run this in your project folder:
composer require phata/widgetfy
[composer]: https://getcomposer.org/download/
// require the composer autoload script
require_once './vendor/autoload.php';
use Phata\Widgetfy\Core as Widgetfy;
// simple setup
if (($embed = Widgetfy::translate($link)) != NULL) {
    echo $embed['html'];
}
// adjust all video to width 640px, if the source support that
$options = array('width'=>640);
if (($embed = Widgetfy::translate($link, $options)) != NULL) {
    echo $embed['html'];
}
// using the default theme, and inlining the default CSS
// along with the first embed code.
echo Phata\Widgetfy\Theme::toHTML($embed, true);
For more detailed documentation, please visit our Documentation page on GitLab.
Branch | Purpose | PHP Version | Status -------|------------------|-------------------|---------------------------------------- 2.x | Stable / Default | 7.1, 7.2 | [![Travis Test Status][ci-badge-2.x]][ci-branches-url] 1.x | Maintenance | 5.3, 5.4 5.5, 5.6 | [![Travis Test Status][ci-badge-1.x]][ci-branches-url] master | Development | 7.1, 7.2 | [![Travis Test Status][ci-badge]][ci-branches-url]
[ci-badge-2.x]: https://gitlab.com/phata/widgetfy/badges/2.x/build.svg [ci-badge-1.x]: https://gitlab.com/phata/widgetfy/badges/1.x/build.svg [ci-badge]: https://gitlab.com/phata/widgetfy/badges/master/build.svg [ci-branches-url]: https://gitlab.com/phata/widgetfy/pipelines?scope=branches&page=1
This file is part of Widgetfy.
Widgetfy is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Widgetfy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public Licensefor more details.
You should have received a copy of the GNU Lesser General Public License along with Widgetfy. If not, see <http://www.gnu.org/licenses/lgpl.html>.
|  Files (83) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  demo (1 file, 2 directories) | ||||
|  src (4 files, 4 directories) | ||||
|  tests (1 file, 4 directories) | ||||
|    .travis.yml | Data | Auxiliary data | ||
|    autoload.php | Appl. | Application script | ||
|    composer.json | Data | Auxiliary data | ||
|    LICENSE | Lic. | License text | ||
|    phpunit.xml | Data | Auxiliary data | ||
|    README.md | Data | Auxiliary data | ||
|  Widgetfy.php | Class | Class source | ||
|  Files (83) | / | demo | 
| File | Role | Description | ||
|---|---|---|---|---|
|  includes (1 file) | ||||
|  misc (2 files) | ||||
|    example1.php | Example | Example script | ||
|  Files (83) | / | demo | / | misc | 
| File | Role | Description | 
|---|---|---|
|    demo.json | Data | Auxiliary data | 
|    example1.css | Data | Auxiliary data | 
|  Files (83) | / | src | 
|  Files (83) | / | src | / | MediaFile | 
| File | Role | Description | 
|---|---|---|
|    ClassicVideo.php | Example | Example script | 
|  Common.php | Class | Class source | 
|  HTML5Video.php | Class | Class source | 
|  RealMediaVideo.php | Class | Class source | 
|  Files (83) | / | src | / | Site | 
| File | Role | Description | 
|---|---|---|
|  BiliBili.php | Class | Class source | 
|  CollegeHumor.php | Class | Class source | 
|  Common.php | Class | Class source | 
|  Dailymotion.php | Class | Class source | 
|  Dorkly.php | Class | Class source | 
|  Facebook.php | Class | Class source | 
|  IGN.php | Class | Class source | 
|  Kickstarter.php | Class | Class source | 
|  Ku6.php | Class | Class source | 
|  LiveLeak.php | Class | Class source | 
|  Metacafe.php | Class | Class source | 
|  MySpace.php | Class | Class source | 
|  NicoNico.php | Class | Class source | 
|  OnCc.php | Class | Class source | 
|  SteamStore.php | Class | Class source | 
|  TED.php | Class | Class source | 
|  Tudou.php | Class | Class source | 
|  Twitter.php | Class | Class source | 
|  V56.php | Class | Class source | 
|  Vimeo.php | Class | Class source | 
|  Xuite.php | Class | Class source | 
|  Youku.php | Class | Class source | 
|  Youtube.php | Class | Class source | 
|  Files (83) | / | src | / | Theme | 
| File | Role | Description | 
|---|---|---|
|    theme.css | Data | Auxiliary data | 
|    theme.tpl.php | Aux. | Auxiliary script | 
|  Files (83) | / | src | / | Utils | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Cache (2 files) | ||||
|  Cache.php | Class | Class source | ||
|  Calc.php | Class | Class source | ||
|  Dimension.php | Class | Class source | ||
|  DimensionError.php | Class | Class source | ||
|  URL.php | Class | Class source | ||
|  Files (83) | / | src | / | Utils | / | Cache | 
| File | Role | Description | 
|---|---|---|
|    Common.php | Test | Unit test script | 
|    FileCache.php | Test | Unit test script | 
|  Files (83) | / | tests | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Core (2 files) | ||||
|  MediaFile (3 files) | ||||
|  Site (22 files) | ||||
|  Utils (3 files, 1 directory) | ||||
|  ThemeTest.php | Class | Class source | ||
|  Files (83) | / | tests | / | Core | 
| File | Role | Description | 
|---|---|---|
|    shortcutTest.php | Test | Unit test script | 
|    WidgetfyTest.php | Test | Unit test script | 
|  Files (83) | / | tests | / | MediaFile | 
| File | Role | Description | 
|---|---|---|
|    ClassicVideoTest.php | Test | Unit test script | 
|    HTML5VideoTest.php | Test | Unit test script | 
|    RealMediaVideoTest.php | Test | Unit test script | 
|  Files (83) | / | tests | / | Site | 
| File | Role | Description | 
|---|---|---|
|  BiliBiliTest.php | Class | Class source | 
|    CollegeHumorTest.php | Test | Unit test script | 
|    DailymotionTest.php | Test | Unit test script | 
|    DorklyTest.php | Test | Unit test script | 
|    FacebookTest.php | Test | Unit test script | 
|    IGNTest.php | Test | Unit test script | 
|    KickstarterTest.php | Test | Unit test script | 
|    Ku6Test.php | Test | Unit test script | 
|    LiveLeakTest.php | Test | Unit test script | 
|    MetacafeTest.php | Test | Unit test script | 
|    MySpaceTest.php | Test | Unit test script | 
|    NicoNicoTest.php | Test | Unit test script | 
|    OnCcTest.php | Test | Unit test script | 
|    SteamStoreTest.php | Test | Unit test script | 
|    TEDTest.php | Test | Unit test script | 
|    TudouTest.php | Test | Unit test script | 
|  TwitterTest.php | Class | Class source | 
|    V56Test.php | Test | Unit test script | 
|    VimeoTest.php | Test | Unit test script | 
|    XuiteTest.php | Test | Unit test script | 
|    YoukuTest.php | Test | Unit test script | 
|    YoutubeTest.php | Test | Unit test script | 
|  Files (83) | / | tests | / | Utils | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Cache (1 file) | ||||
|    CalcTest.php | Test | Unit test script | ||
|    DimensionTest.php | Test | Unit test script | ||
|    URLTest.php | Test | Unit test script | ||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| Applications that use this package | 
| Official repository page | 
| Documentation of the library | 
| Please use Github issue tracker to report issue | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.