PHP Classes
elePHPant
Icontem

Widgetfy: Generate HTML to embed video content of given URL

Recommend this page to a friend!
  Info   View files Example   View files View files (84)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-02-22 (2 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 279 All time: 7,355 This week: 517Up
Version License PHP version Categories
phata-widgetfy 1.7GNU Lesser Genera...5.3HTML, PHP 5, Content management, Video
Description Author

This package can generate HTML to embed video content of given URL.

It can take a URL of a given site and validate it to tell if it supports embedding the content of the specified site.

The package comes with different classes that support generating HTML to embed the content of the given site URL.

Currently the class can embed content of video sites like CollegeHumor, Dailymotion, Dorkly, Facebook, IGN, Kickstarter, Ku6, LiveLeak, Metacafe, MySpace, NicoNico, OnCc, SteamStore, TED, Tudou, V56, Vimeo, Xuite, Youku, and Youtube.

Name: Koala Yeung <contact>
Classes: 1 package by
Country: Hong Kong Hong Kong
Age: 36
All time rank: 371515 in Hong Kong Hong Kong
Week rank: 918 Up4 in Hong Kong Hong Kong Up

Details

Widgetfy

Widgetfy is a PHP library to translate URLs of video sites into the embed / widget.

Install

First, install [composer] to your development platform.

Then run this in your project folder:

composer require phata/widgetfy

[composer]: https://getcomposer.org/download/

Example Code


// 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 GitHub.

Branches

Branch | Purpose | PHP Version | Status -------|------------------|-------------------|---------------------------------------- 2.x | Stable / Default | 7.1, 7.2 | ![Travis Test Status][travis-badge-2.x] 1.x | Maintenance | 5.3, 5.4 5.5, 5.6 | ![Travis Test Status][travis-badge-1.x] master | Development | 7.1, 7.2 | ![Travis Test Status][travis-badge]

[travis-badge-2.x]: https://api.travis-ci.org/phata/widgetfy.svg?branch=2.x [travis-badge-1.x]: https://api.travis-ci.org/phata/widgetfy.svg?branch=1.x [travis-badge]: https://api.travis-ci.org/phata/widgetfy.svg?branch=master

License

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 folder image Files  
File Role Description
Files folder imagedemo (1 file, 2 directories)
Files folder imagesrc (4 files, 4 directories)
Files folder imagetests (1 file, 4 directories)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file autoload.php Appl. Application script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data
Plain text file Widgetfy.php Class Class source

  Files folder image Files  /  demo  
File Role Description
Files folder imageincludes (1 file)
Files folder imagemisc (2 files)
  Accessible without login Plain text file example1.php Example Example script

  Files folder image Files  /  demo  /  includes  
File Role Description
  Accessible without login Plain text file common.php Example Example script

  Files folder image Files  /  demo  /  misc  
File Role Description
  Accessible without login Plain text file demo.json Data Auxiliary data
  Accessible without login Plain text file example1.css Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageMediaFile (4 files)
Files folder imageSite (23 files)
Files folder imageTheme (2 files)
Files folder imageUtils (5 files, 1 directory)
  Plain text file Core.php Class Class source
  Plain text file MediaFile.php Class Class source
  Plain text file Site.php Class Class source
  Plain text file Theme.php Class Class source

  Files folder image Files  /  src  /  MediaFile  
File Role Description
  Accessible without login Plain text file ClassicVideo.php Example Example script
  Plain text file Common.php Class Class source
  Plain text file HTML5Video.php Class Class source
  Plain text file RealMediaVideo.php Class Class source

  Files folder image Files  /  src  /  Site  
File Role Description
  Plain text file BiliBili.php Class Class source
  Plain text file CollegeHumor.php Class Class source
  Plain text file Common.php Class Class source
  Plain text file Dailymotion.php Class Class source
  Plain text file Dorkly.php Class Class source
  Plain text file Facebook.php Class Class source
  Plain text file IGN.php Class Class source
  Plain text file Kickstarter.php Class Class source
  Plain text file Ku6.php Class Class source
  Plain text file LiveLeak.php Class Class source
  Plain text file Metacafe.php Class Class source
  Plain text file MySpace.php Class Class source
  Plain text file NicoNico.php Class Class source
  Plain text file OnCc.php Class Class source
  Plain text file SteamStore.php Class Class source
  Plain text file TED.php Class Class source
  Plain text file Tudou.php Class Class source
  Plain text file Twitter.php Class Class source
  Plain text file V56.php Class Class source
  Plain text file Vimeo.php Class Class source
  Plain text file Xuite.php Class Class source
  Plain text file Youku.php Class Class source
  Plain text file Youtube.php Class Class source

  Files folder image Files  /  src  /  Theme  
File Role Description
  Accessible without login Plain text file theme.css Data Auxiliary data
  Accessible without login Plain text file theme.tpl.php Aux. Auxiliary script

  Files folder image Files  /  src  /  Utils  
File Role Description
Files folder imageCache (2 files)
  Plain text file Cache.php Class Class source
  Plain text file Calc.php Class Class source
  Plain text file Dimension.php Class Class source
  Plain text file DimensionError.php Class Class source
  Plain text file URL.php Class Class source

  Files folder image Files  /  src  /  Utils  /  Cache  
File Role Description
  Accessible without login Plain text file Common.php Test Unit test script
  Accessible without login Plain text file FileCache.php Test Unit test script

  Files folder image Files  /  tests  
File Role Description
Files folder imageCore (2 files)
Files folder imageMediaFile (3 files)
Files folder imageSite (22 files)
Files folder imageUtils (3 files, 1 directory)
  Plain text file ThemeTest.php Class Class source

  Files folder image Files  /  tests  /  Core  
File Role Description
  Accessible without login Plain text file shortcutTest.php Test Unit test script
  Accessible without login Plain text file WidgetfyTest.php Test Unit test script

  Files folder image Files  /  tests  /  MediaFile  
File Role Description
  Accessible without login Plain text file ClassicVideoTest.php Test Unit test script
  Accessible without login Plain text file HTML5VideoTest.php Test Unit test script
  Accessible without login Plain text file RealMediaVideoTest.php Test Unit test script

  Files folder image Files  /  tests  /  Site  
File Role Description
  Plain text file BiliBiliTest.php Class Class source
  Accessible without login Plain text file CollegeHumorTest.php Test Unit test script
  Accessible without login Plain text file DailymotionTest.php Test Unit test script
  Accessible without login Plain text file DorklyTest.php Test Unit test script
  Accessible without login Plain text file FacebookTest.php Test Unit test script
  Accessible without login Plain text file IGNTest.php Test Unit test script
  Accessible without login Plain text file KickstarterTest.php Test Unit test script
  Accessible without login Plain text file Ku6Test.php Test Unit test script
  Accessible without login Plain text file LiveLeakTest.php Test Unit test script
  Accessible without login Plain text file MetacafeTest.php Test Unit test script
  Accessible without login Plain text file MySpaceTest.php Test Unit test script
  Accessible without login Plain text file NicoNicoTest.php Test Unit test script
  Accessible without login Plain text file OnCcTest.php Test Unit test script
  Accessible without login Plain text file SteamStoreTest.php Test Unit test script
  Accessible without login Plain text file TEDTest.php Test Unit test script
  Accessible without login Plain text file TudouTest.php Test Unit test script
  Plain text file TwitterTest.php Class Class source
  Accessible without login Plain text file V56Test.php Test Unit test script
  Accessible without login Plain text file VimeoTest.php Test Unit test script
  Accessible without login Plain text file XuiteTest.php Test Unit test script
  Accessible without login Plain text file YoukuTest.php Test Unit test script
  Accessible without login Plain text file YoutubeTest.php Test Unit test script

  Files folder image Files  /  tests  /  Utils  
File Role Description
Files folder imageCache (1 file)
  Accessible without login Plain text file CalcTest.php Test Unit test script
  Accessible without login Plain text file DimensionTest.php Test Unit test script
  Accessible without login Plain text file URLTest.php Test Unit test script

  Files folder image Files  /  tests  /  Utils  /  Cache  
File Role Description
  Accessible without login Plain text file FileCacheTest.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:279
This week:0
All time:7,355
This week:517Up