Skip to content
Snippets Groups Projects
Commit f2afdf87 authored by Jennifer Dust's avatar Jennifer Dust
Browse files

Issue #3488792 by jldust: Component: Update Video Props

parent 712d321d
No related branches found
No related tags found
1 merge request!154Resolve #3488792 "Component update video"
@use 'partials' as *;
.c-video__video-wrapper {
.c-video__wrapper {
position: relative;
}
......
$schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json
name: "Video"
status: "experimental"
description: "A simple video component"
name: 'Video'
status: 'experimental'
description: 'A simple video component'
slots:
video_media_block: {}
video_caption_block: {}
media_block: {}
caption_block: {}
props:
type: object
required:
- video_media
- media
properties:
video_title:
type: "string"
title: "Video Title"
description: "The title for the video."
title:
type: 'string'
title: 'Video Title'
description: 'The title for the video.'
examples:
- "YouTube Example"
- "Vimeo Example"
video_media:
type: "string"
title: "Video URL"
description: "The embed url for either YouTube or Vimeo."
- 'YouTube Example'
- 'Vimeo Example'
media:
type: 'string'
title: 'Video URL'
description: 'The embed url for either YouTube or Vimeo.'
examples:
- "https://youtu.be/0RWs6uxR9yg"
- "https://player.vimeo.com/video/728948316"
video_caption:
type: "string"
title: "Caption Text"
description: "The caption text for video."
- 'https://youtu.be/0RWs6uxR9yg'
- 'https://player.vimeo.com/video/728948316'
caption:
type: 'string'
title: 'Caption Text'
description: 'The caption text for video.'
examples:
- "In exercitation in tempor ea enim elit id consequat."
- "Nostrud in excepteur cupidatat eu consequat consequat proident ut occaecat reprehenderit do do ipsum. Fugiat incididunt culpa exercitation sit ad nisi laborum esse deserunt dolor in laborum."
- 'In exercitation in tempor ea enim elit id consequat.'
- 'Nostrud in excepteur cupidatat eu consequat consequat proident ut occaecat reprehenderit do do ipsum. Fugiat incididunt culpa exercitation sit ad nisi laborum esse deserunt dolor in laborum.'
.c-video__video-wrapper {
.c-video__wrapper {
position: relative;
}
......
{% set video_classes = ['c-video']|merge(classes|default([])) %}
<figure {{ attributes.addClass(video_classes) }}>
{% set classes = ['c-video']|merge(classes|default([])) %}
<figure {{ attributes.addClass(classes) }}>
{% block video_media_block %}
{% if video_media %}
<div class='c-video__video-wrapper'>
<iframe src="{{ video_media }}" frameborder='0' allowtransparency='' width='426' height='240' title="{{ video_title }}"></iframe>
{% block media_block %}
{% if media %}
<div class='c-video__wrapper'>
<iframe src="{{ media }}" frameborder='0' allowtransparency='' width='426' height='240' title="{{ title }}"></iframe>
</div>
{% endif %}
{% endblock %}
{% block video_caption_block %}
{% if video_caption %}
{% block caption_block %}
{% if caption %}
<figcaption class='c-video__caption'>
{{video_caption}}
{{caption}}
</figcaption>
{% endif %}
{% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment