PHP Video Plugin


This video plugin can take a YouTube or Vimeo url and return an array of info such as a thumbnail image, title, length, tags, views, etc. It can even automatically embed the video into the page. It uses the newer iframe embed method which adds html5 support to both YouTube & Vimeo video which means they can be play on mobile devices such as iPhone and Android.

Requires PHP 5.2+ with JSON support.

Embed Video

Embedding a video is super easy. Just input a YouTube or Vimeo url and optional dimensions like so:

echo $video->embed('http://www.youtube.com/watch?v=AZW9NYX6JZA', '630', '350');

Result

PHP Video Plugin - 1

Video Info

To pull the info for a video all you need to do is pass the url of the video you’re interested in. The function will automatically determine the type and return an array of relevant data.

$info = $video->info('http://www.youtube.com/watch?v=AZW9NYX6JZA');

// Information returned from a YouTube link
$info['video_id']
$info['published']
$info['updated']
$info['title']
$info['info']
$info['user']
$info['comments']
$info['category']
$info['duration']
$info['category']
$info['tags']
$info['thumb_1']
$info['thumb_2']
$info['thumb_3']
$info['thumb_large']
$info['favorites']
$info['views']

YouTube Thumbnails

PHP Video Plugin - 2

YouTube Data

Video id: AZW9NYX6JZA
Published date: 2009-04-09T18:59:13.000Z
Last updated: 2011-01-26T09:01:46.000Z
Title: St Vincent – “Actor Out Of Work”
Info: Check out the first single “Actor Out Of Work” from St. Vincent’s newest album Actor. Buy her magnificent new album here: beggarsgroupusa.com
User: 4ADRecords
Comments: 574
Category: Check out the first single “Actor Out Of Work” from St. Vincent’s newest album Actor. Buy her magnificent new album here: beggarsgroupusa.com
Duration: 150
Category: Check out the first single “Actor Out Of Work” from St. Vincent’s newest album Actor. Buy her magnificent new album here: beggarsgroupusa.com
Tags: St. Vincent, Actor Out Of Work, Actor, 4AD, Sufjan Stevens, Polyphonic Spree
Favorited: 4219
Views: 483931

While the function will automatically determine if your video is from YouTube or Vimeo, the respective API’s each return slightly different data. We’ve already seen what info you can get back from a YouTube video, now here’s an example of the data returned from Vimeo:

$info = $video->info('http://vimeo.com/14173983');

// Information return from a Vimeo link
$info['video_id']
$info['status']
$info['title']
$info['info']
$info['mobile_url']
$info['thumb_small']
$info['thumb_med']
$info['thumb_large']
$info['user']
$info['user_url']
$info['user_thumb_small']
$info['user_thumb_medium']
$info['user_thumb_large']
$info['user_thumb_huge']
$info['likes']
$info['plays']
$info['comments']
$info['duration']
$info['width']
$info['height']
$info['tags']
$info['embed']

Vimeo Thumbnails

PHP Video Plugin - 3

Vimeo Data

Video id: 14173983
Title: Joshua Tree Under the Milky Way

Info: Timelapse video of the Perseid Meteor Shower and the galactic core of the Milky Way as seen from Joshua Tree National Park.

These were taken between August 12 and August 15, 2010.

For more photos and words: http://photography.evosia.com/2010/08/13/under-the-milky-way-in-joshua-tree-national-park/

Website: http://www.evosia.com
Facebook:http://www.facebook.com/evosiastudios
Twitter: http://twitter.com/evosia

Gear: 5D Mk II, EF 16-35mm L. Settings: f/2.8, 6400 ISO, 20 second exposures.

Music is Samskeyti by Sigur Ros
Likes: 2501
Plays: 572653
Comments: 261
Duration: 65
Width: 640
Height: 360
Tags: Perseid Meteor Shower, Milky Way, timelapse, joshua tree national park, canon 5d Mk II

Vimeo User Info

User: Henry Jun Wah Lee
User url: http://vimeo.com/evosia

PHP Video Plugin - 4

More Files From the PHP Plugin Suite

Bitly

Image Plugin

Map + Weather Plugin

Twitter Plugin

Weather Plugin

pose css

Source
Live PreviewDownload Now

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :

You May Also Like
Read More

Wine Animation – HTML5 Canvas

Wine Animation is a jQuery plugin that transform a HTML5 canvas element into configurable wine animation using CreateJS…
Read More

Bitcoin Faucet List

NEW WordPress Version Now Available! Looking for a wordpress plugin that does the same thing as this script?…
Read More

WooCommerce Cart Based Shipping

Cart Based shipping allows you to set different shipping rates based on the items a customer has in…
Read More

Dunk Ball – Html5 Game (CAPX)

GAME FEATURES: – Beautiful graphics – Clean and organized capx code – Made with Construct 2 – Capx…