This project is not covered by Drupal’s security advisory policy.

This module adds a YouTube ID formatter for "Media: YouTube" field.
It is an adaptation of Media URL formatter.

Extracts & displays the youtube ID from the URI. Can be used to rewrite fields.

function theme_media_yt_id_formatter($variables) {
  $item = $variables['item'];
  $uri = $item['uri'];
  $video_id = substr($uri, strrpos($uri, "v/")+2);
  return $video_id;
}

Project information

Releases