Skip to content

Commit

Permalink
Merge pull request #1155 from City-of-Helsinki/UHF-10406
Browse files Browse the repository at this point in the history
UHF-10406: Check if video src is null
  • Loading branch information
hyrsky authored Jan 13, 2025
2 parents c8805ef + 09b6eeb commit 2b6a5b8
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions templates/media/media--remote-video.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,31 @@
{% set service_url = media.getServiceUrl() %}
{% set privacy_policy_url = media.getPrivacyPolicyUrl() %}

{% include '@hdbt/misc/embedded-content-cookie-compliance.twig' with {
media_url: media_url,
media_id: media.id,
media_iframe_title: iframe_title,
media_service_url: service_url,
privacy_policy_url: privacy_policy_url,
} %}
{% if not media_attributes.src is null %}
{% include '@hdbt/misc/embedded-content-cookie-compliance.twig' with {
media_url: media_url,
media_id: media.id,
media_iframe_title: iframe_title,
media_service_url: service_url,
privacy_policy_url: privacy_policy_url,
} %}

{% set drupal_settings = {
'#attached': {
'drupalSettings': {
'embedded_media_attributes': {
(media.id): {
'src': media_attributes.src,
'height': media_attributes.height,
'width': media_attributes.width,
'title': 'Video: ' ~ iframe_title,
'type': 'video',
{% set drupal_settings = {
'#attached': {
'drupalSettings': {
'embedded_media_attributes': {
(media.id): {
'src': media_attributes.src,
'height': media_attributes.height,
'width': media_attributes.width,
'title': 'Video: ' ~ iframe_title,
'type': 'video',
}
}
}
}
}
} %}
} %}

{{ drupal_settings }}
{{ attach_library(media.getJsLibrary()) }}
{{ drupal_settings }}
{{ attach_library(media.getJsLibrary()) }}
{% endif %}

0 comments on commit 2b6a5b8

Please sign in to comment.