function hook_preprocess_video_embed_iframe in Video Embed Field 8
Same name and namespace in other branches
- 8.2 video_embed_field.api.php \hook_preprocess_video_embed_iframe()
Preprocess video iframes.
For video providers that use the "video_embed_iframe" element, you can preprocess the element to access the individual components which make up the iframe including:
- url: The URL of the iframe, excluding the query parameters.
- query: Individually manipulatable query string parameters.
- attributes: The attributes on the iframe HTML element.
- provider: The provider which has rendered the iframe, available for conditional logic only, should not be changed.
File
- ./
video_embed_field.api.php, line 20 - Hooks provided by video_embed_field.
Code
function hook_preprocess_video_embed_iframe(&$variables) {
// Add a class to all iframes that point to vimeo.
if ($variables['provider'] == 'vimeo') {
$variables['attributes']['class'][] = 'vimeo-embed';
}
}