templatetags - get youtube video id
Returns `Video_ID` extracting from the given url of Youtube.
- django
- templatetags
- youtube
Returns `Video_ID` extracting from the given url of Youtube.
[code] {% get_video_urls url as url_object %} or get object attribute: {% get_video_urls obj "url" as url_object %} {{ url_object }} original url {{ url_object.video_id }} original url or video_id {{ url_object.resource }} youtube, vimeo, None {{ url_object.iframe_url }} original url or iframe_url {{ url_object.js_api_url }} original url or js_api_url [/code]
Tag for simple embed video from youtube watch link. It can be modified to manage size of embedded video.
This is a function based on django's urlize modified to show different media based on their url. It supports images, links, mp3/ogg links, youtube videos, vimeo videos and dailymotion videos. I added a switch called mini to have two modes to show things in different places. When mini is activated it will only parse the first url provided and discard the rest as well as limiting the height.
It gets the thumbnail picture url from a youtube video url. Example <img src="{{vide.url|youthumbnail:'s'}}"/> It supports 2 sizes small(s) and large (l)
Given a youtube url (can copy and paste right from the browser) turns the url into an embedded video. If you put this in your app's templatetags/filters.py, you can do the following >{{ object.youtube_url|youtube }} and it would embed the youtube video.
This snippet is based on djangos urlize filter. It converts http:// links to youtube into youtube-embed statements, so that one can provide a simple link to a youtube video and this filter will embed it. I used it for a fun blog app.
7 snippets posted so far.