@@ 43-45 (lines=3) @@ | ||
40 | $entity = $contexts['entity']; |
|
41 | ||
42 | // For video and audio files, limit the available options to the media player. |
|
43 | if ($entity instanceof \Drupal\file\FileInterface && in_array($entity->bundle(), ['audio', 'video'])) { |
|
44 | $definitions = array_intersect_key($definitions, array_flip(['file:jwplayer_formatter'])); |
|
45 | } |
|
46 | ||
47 | // For images, use the image formatter. |
|
48 | if ($entity instanceof \Drupal\file\FileInterface && in_array($entity->bundle(), ['image'])) { |
|
@@ 48-50 (lines=3) @@ | ||
45 | } |
|
46 | ||
47 | // For images, use the image formatter. |
|
48 | if ($entity instanceof \Drupal\file\FileInterface && in_array($entity->bundle(), ['image'])) { |
|
49 | $definitions = array_intersect_key($definitions, array_flip(['image:image'])); |
|
50 | } |
|
51 | ||
52 | // For nodes, use the default option. |
|
53 | if ($entity instanceof \Drupal\node\NodeInterface) { |