pokap / media
Simply media loading meta-data per link.
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/pokap/media
Requires
- php: >=5.3.3
- scottmac/opengraph: *
- zendframework/zendframework: *
This package is not auto-updated.
Last update: 2022-02-01 12:20:31 UTC
README
A simple way to get metadata of media link.
Requires at least PHP 5.3.3 because uses Zend library. Compatible PHP 5.4 too.
This package uses Zend framework (https://github.com/zendframework/zf2), and OpenGraph (https://github.com/scottmac/opengraph) to get meta-data with open graph protocol (http://ogp.me/).
Usage
<?php $media = new \Pok\Media\Media(); // one service equal to one class // several filters to find the service in relation to the links, be careful not to forget the scheme $media->getServiceManager()->setService( 'youtube', 'Pok\\Media\\Service\\Youtube', array('http:\/\/(www\.)?youtube\.com') ); $uri = new \Zend\Uri\Uri('http://www.youtube.com/watch?v=uh9oUHO2dxE&useless_data'); // get instance of \Pok\Media\Service\Youtube with id (uh9oUHO2dxE), title, description of video, etc. // false if error. $service = $media->analyse($uri); echo $uri->toString(); // http://www.youtube.com/watch?v=uh9oUHO2dxE ?>