Display Auto Generated Youtube Thumbnails with ‘Video Embed Field’ Module in Views

I added some videos to my site and I’m using views to display them. I followed a tutorial and i used the rewrite the output option of the view with allowed replacement patterns to display videos in lightbox in this way.

<a href="[field_video-video-url]" rel="lightvideo"><img src="[field_vthumb]" 
height="120" width="180"></a>

Here when i clicked on the a image, the video will played in the lightbox and that was great.
In the above link added a custom the image field as thumbnail but that doesn’t work well, because when i add more than one video all will have the same thumbnail.

But then i also came to know, that the Video Embed Module when used to add videos, auto generates the thumbails of the added youtube videos in a public directory. So again i worked on the replacement patterns and got the raw thumbnail field generated by the Video Embed Module.

Again i rewrote the output with the raw thumbnail as image

 <a href="[field_video-video-url]" rel="lightvideo"><img src="[field_video-thumbnail_path]" 
 height="120" width="180"></a>

But the thumbnail image is broken and the image path is shown as
public://video_embed_field_thumbnails/youtube/RQieoqCLWDo.jpg which i guess is not recognized by drupal.

So my point here is, Is there a way to access the raw thumbnail in the rewrite patterns so that every youtube video gets its own thumbnail without manually adding image as thumbnail.

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Display Auto Generated Youtube Thumbnails with ‘Video Embed Field’ Module in Views

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.