snowpatch/videoparser

Easily get the provider, video ID or embed URL of Youtube or Vimeo videos

dev-main 2022-08-09 18:22 UTC

This package is auto-updated.

Last update: 2025-06-10 00:10:54 UTC


README

License: AGPL v3

Lightweight video parsing library. Easily get the provider, video ID or embed URL of Youtube or Vimeo videos.


Usage

use SnowPatch\VideoParser;

// Get video provider eg. "YouTube"
$provider = VideoParser::getProvider('https://www.youtube.com/watch?v=xLs_Q4Ge7s4');

// Get video ID
$vid = VideoParser::getId('https://www.youtube.com/watch?v=xLs_Q4Ge7s4');

// Get video embed code
$embed = VideoParser::getEmbed('https://www.youtube.com/watch?v=xLs_Q4Ge7s4');