iframe title attribute for <video> ?

42 views
Skip to first unread message

John Hammond

unread,
Aug 25, 2026, 8:30:01 PMAug 25
to PreTeXt support
Hello! 

My pretext book was hosted on my university web site, but it was flagged as non-compliant for WCAG 2.1 standards, with <iframes> not having titles being one of the big culprits. 

I'm heavily using the <video> tag to embed short video solutions to examples, and a tag such as:

      <video youtube="dQw4w9WgXcQ" Title="does this render" label="BLAHBLAHBLAH"/>

becomes 

      <iframe class="video" allowfullscreen="" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?&amp;modestbranding=1&amp;rel=0" id="BLAHBLAHBLAH"></iframe>

I chose @Title because it was specified in the schema. There isn't an entry for @title. Unfortunately, for standard html output, it is ignored.

Is it possible to programmatically generate the title for the iframe, or should I convert things to <interactive iframe> or something else? Thanks!


Mitch Keller

unread,
Aug 25, 2026, 9:20:35 PMAug 25
to pretext...@googlegroups.com
The schema specifies a title element as a child of a video element, not a title attribute. What happens if you try that?
-- 
Mitch Keller

On Aug 25, 2026, at 19:30, John Hammond <jmha...@gmail.com> wrote:

Hello! 
--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/c1ea326f-6600-409f-a13a-b0cb79e5daaan%40googlegroups.com.

Andrew Scholer

unread,
Aug 25, 2026, 9:44:43 PMAug 25
to pretext...@googlegroups.com
It does not look like there is code to emit a <title> subelement as an @title in the html output. That is an easy fix, but raises some bigger issues:

1) <title> should be a required child of <video>s that make iframes so that HTML output passes WCAG. (Required = strong warning if missing.) I don't think authors should have to know which videos might end up in iframes, which means all videos probably should have titles.

2) Anything that gets rendered to an <iframe> needs a meaningful @title in the output. Which probably means the author will need to provide one. That will be a more extensive set of updates (with more items likely requiring an authored title).

I made an issue for #2: https://github.com/PreTeXtBook/pretext/issues/3179


Mitch Keller

unread,
Aug 25, 2026, 9:56:36 PMAug 25
to pretext...@googlegroups.com
Based on this https://getwcag.com/en/accessibility-guide/frame-title, I think automatically specified @title would be fine, as the suggestion is the issue is an iframe lacking title is just a mystery box for the screenreader user. So an interactive with slate[@platform=‘sage’] could just report a title of “interactive sage graphic”. We already support proper descriptions for what’s in there. 
-- 
Mitch Keller

On Aug 25, 2026, at 20:44, Andrew Scholer <asch...@chemeketa.edu> wrote:


Message has been deleted

Sean Fitzpatrick

unread,
Aug 26, 2026, 12:06:39 AMAug 26
to pretext...@googlegroups.com
In other formats that get rendered in an iframe (Asymptote, some interactive) I believe the shortdescription is used for the iframe title. 

I'm not sure if it's implemented for video. If not, perhaps it wouldn't be too hard to copy over the code used elsewhere? 

If/once it's in place, you would do
<video youtube="foo" width="bar%>
  <shortdescription>Some ASCII title text</shortdescription>
</video>

Andrew Scholer

unread,
Aug 26, 2026, 9:53:46 AMAug 26
to pretext...@googlegroups.com
I had thought there was something about avoiding duplicate titles, but it looks like I was mistaken. So yes, I agree, auto generating for known interactive types seems fine.

I also see now that @shortdescription on an iframe gets rendered to an @title. So maybe all we need is generic fallbacks for when that is missing.

John Hammond

unread,
Aug 28, 2026, 10:36:34 AM (14 days ago) Aug 28
to PreTeXt support
Thanks for noting that and opening the issue. 

Mitch, I tried the sub-element approach, but sadly
```
      <video youtube="cNiSxQsOloI">
        <title>zzzzzzzz</title>
      </video> 
```

didn't produce the string "zzzzz" anywhere in the generated html. 

I will thank everyone, though, on the work towards accessibility. This project is fantastic.

Sean Fitzpatrick

unread,
Aug 28, 2026, 10:37:38 AM (14 days ago) Aug 28
to pretext...@googlegroups.com
Can you see what happens if you replace title by shortdescription? 

John Hammond

unread,
Aug 29, 2026, 8:33:55 AM (13 days ago) Aug 29
to pretext...@googlegroups.com
When I tried including either @shortdescription or as its own tag:

```
        <video youtube="EG531mTSNRQ" shortdescription="THISTEXT">
          <shortdescription>ZZZ</shortdescription>
        </video>
```

and neither string "ZZZ" nor "THISTEXT" shows up in the generated html code. Here's the html that I get:

```
                                        <div class="video-box" style="width: 100%;padding-top: 56.25%; margin-left: 0%; margin-right: 0%;">
                                            <iframe class="video" allowfullscreen="" src="https://www.youtube-nocookie.com/embed/EG531mTSNRQ?&amp;modestbranding=1&amp;rel=0" id="subsec-truthtables-4-2-1"></iframe>
                                        </div>
                                        <div class="autopermalink" aria-hidden="true" data-description="Video / Answer 1.1.11.1">
                                            <a tabindex="-1" href="#subsec-truthtables-4-2" title="Copy heading and permalink for Video / Answer 1.1.11.1" aria-label="Copy heading and permalink for Video / Answer 1.1.11.1">🔗</a>
                                        </div>
```

Using pretext-cli 2.50.0

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/O8Qv2CUrdu8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPZ258U-R3RWaQrvbBG7z7jcsWSqEOTcAUDj2NLq%2B_h70g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages