Vidinfo package takes $url
parameter and returns video info via oembed urls from the following service providers:
- YouTube
- Vimeo
$ composer require josip/vidinfo
Use it in static fashion:
\Josip\Vidinfo\Vidinfo::getVideoInfo($url)
in order to return array or JSON string, add in the optional second argument:
\Josip\Vidinfo\Vidinfo::getVideoInfo($url, $returnType)
The $returnType
var can be: object
, array
, json
. Falls back to array
.
Free as in free beer.