https://github.com/dgrebb/youtube-id-from-url
A quick and easy ExpressionEngine plugin to grab a YouTube video ID from a longer URL.
https://github.com/dgrebb/youtube-id-from-url
Last synced: 11 months ago
JSON representation
A quick and easy ExpressionEngine plugin to grab a YouTube video ID from a longer URL.
- Host: GitHub
- URL: https://github.com/dgrebb/youtube-id-from-url
- Owner: dgrebb
- Created: 2012-12-02T02:49:16.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-02T02:49:18.000Z (over 13 years ago)
- Last Synced: 2025-04-01T16:19:42.858Z (about 1 year ago)
- Language: PHP
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This plugin is useful for slicing up member-supplied YouTube URLs for iframe embeds.
If a user submits any of the below in Text Input custom field type, wrap it in this plugin's tags to output just the ID of the YouTube video.
http://www.youtube.com/watch?v=dQw4w9WgXcQ
http://youtu.be/dQw4w9WgXcQ
http://www.youtube.com/embed/dQw4w9WgXcQ
Usage:
{exp:youtube_id_from_url}
{custom_field}
{/exp:youtube_id_from_url}
Any of the above URLs would render as "dQw4w9WgXcQ".
Special thanks goes to this [Stack Exchange thread](http://stackoverflow.com/questions/6556559/youtube-api-extract-video-id/).