Skip to content

Commit

Permalink
Merge pull request #12637 from craftcms/feature/video-text-alternative
Browse files Browse the repository at this point in the history
When alternative text field is used for a video asset, the transcript is shown in preview modals
  • Loading branch information
brandonkelly authored Feb 10, 2023
2 parents 205c85f + 33a0f7f commit 0994f1d
Show file tree
Hide file tree
Showing 33 changed files with 69 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Improved _conditional_ and _required_ field indicators for screen readers. ([#12509](https://github.com/craftcms/cms/pull/12509))
- Improved bulk element action triggers on element index pages. ([#12415](https://github.com/craftcms/cms/pull/12415))
- Improved the color contrast of element indexes. ([#12213](https://github.com/craftcms/cms/pull/12213))
- Asset preview modals now show videos’ alt text. ([#12637](https://github.com/craftcms/cms/pull/12637))

### Administration
- Conditional layout components are now identified using a condition icon within field layout designers. ([#12250](https://github.com/craftcms/cms/issues/12250))
Expand Down
16 changes: 15 additions & 1 deletion src/templates/assets/_previews/video.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<video autoplay controls style="width: 100%; height: 100%">
{% set height = asset.alt ? '70%' : '100%' %}
{% set transcriptHeight = '30%' %}

<video autoplay controls style="width: 100%; height: {{ height }};">
<source src="{{ url }}" type="{{ asset.mimeType }}">
Your browser does not support the video tag.
</video>

{% if asset.alt %}
<div class="video-transcript" tabindex="0" style="height: {{ transcriptHeight }};">
<div class="video-transcript__inner">
<h2 class="video-transcript__heading">{{ 'Transcript'|t('app') }}</h2>
<p class="video-transcript__text">
{{ asset.alt|nl2br }}
</p>
</div>
</div>
{% endif %}
1 change: 1 addition & 0 deletions src/translations/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@
'Total Price' => 'Total Price',
'Total releases' => 'Total releases',
'Townland' => 'Townland',
'Transcript' => 'Transcript',
'Transfer it to:' => 'Transfer it to:',
'Transform Filesystem' => 'Transform Filesystem',
'Transform Subpath' => 'Transform Subpath',
Expand Down
3 changes: 1 addition & 2 deletions src/web/assets/admintable/dist/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/web/assets/admintable/dist/css/app.css.map

This file was deleted.

2 changes: 1 addition & 1 deletion src/web/assets/admintable/dist/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/admintable/dist/js/app.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/admintable/dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"app.css":"/css/app.css","app.js":"/js/app.js","app.css.map":"/css/app.css.map","app.js.map":"/js/app.js.map"}
{"app.css":"/css/app.css","app.js":"/js/app.js","app.js.map":"/js/app.js.map"}
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css.map

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/web/assets/cp/src/css/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5395,6 +5395,30 @@ $min2ColWidth: 400px;
}
}

/* ----------------------------------------
/* Alternative Text
/* ----------------------------------------*/
.video-transcript {
background-color: var(--gray-050);
overflow-y: scroll;
font-size: 1rem;
position: relative;

@include focus-styles {
// Unset default
box-shadow: none;
color: var(--white);
background-color: var(--gray-800);
}
}

.video-transcript__inner {
margin-left: auto;
margin-right: auto;
max-width: 550px;
padding: var(--xl);
}

/* ----------------------------------------
/* Menus
/* ----------------------------------------*/
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/dashboard/dist/css/Dashboard.css.map

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions src/web/assets/edittransform/dist/css/transforms.css.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/edituser/dist/css/profile.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/generalsettings/dist/css/rebrand.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/graphiql/dist/css/graphiql.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/installer/dist/css/install.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/login/dist/css/login.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/money/dist/css/Money.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/plugins/dist/css/PluginManager.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/pluginstore/dist/css/app.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/pluginstore/dist/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/pluginstore/dist/js/app.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/routes/dist/css/routes.css.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/updater/dist/css/Updater.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/updates/dist/css/UpdatesUtility.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/upgrade/dist/css/UpgradeUtility.css.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/utilities/dist/css/utilities.css.map

Large diffs are not rendered by default.

0 comments on commit 0994f1d

Please sign in to comment.