Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
iframes right now have no indication of what the content is. For screen readers, this can be problematic, as the only information they get is that it's an iframe. Simple patch below, just adds title="Embedded video" to the youtube and vimeo handlers.
Comment | File | Size | Author |
---|---|---|---|
#7 | a11y-video-title.patch | 1.06 KB | Webbeh |
#5 | video_embed_field-1888488-5.patch | 549 bytes | karenann |
#2 | accessibility_screen_readers-1888488-2.patch | 1.73 KB | Anonymous (not verified) |
Issue fork video_embed_field-1888488
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
wbobeirne CreditAttribution: wbobeirne commentedComment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedre-rolled patch against latest 7.x-2.x code
Comment #3
sheldonreed3 CreditAttribution: sheldonreed3 as a volunteer commentedThe patch seems to work as designed. While it addresses the issue, I think we should have an option to make this title more descriptive/definable, or grab it from the video. If there is interest I can roll some options around in my spare time. Any thoughts?
Comment #4
Kleve CreditAttribution: Kleve at Happiness commentedAgree with @sheldonreed3, it should be more descriptive. At least we should give the editor the ability to do so. The title should describe the contents of the embedded content, not that it is an embedded content.
A separate title field on the edit form with the fallback text "Embedded video" if left empty maybe?
Comment #5
karenann CreditAttribution: karenann as a volunteer commentedThis is by no means a "fix" but I'm attaching a stop gap for Drupal 8.
Comment #7
WebbehI ended up pursuing the idea pitched in #4, which was to add a quick 'more descriptive' label for YouTube.
It's not a slam-dunk, but since the YouTube scraper already has the mechanism to collect and incorporate this metadata. This patch extends the YouTube handler to add in the title, array[0]['snippet']['title'], as output from video_embed_field_handle_youtube_data($url).
Comment #8
lias CreditAttribution: lias commentedAdding #7 patch worked and removed failing on iframe in audit for Drupal 7.61
Thanks
Comment #9
WebbehRealizing this needs a slide for review given #7: https://www.drupal.org/project/video_embed_field/issues/1888488#comment-...
Comment #10
streever CreditAttribution: streever commented#7 doesn't seem to be valid; it applies to a folder & file that doesn't exist in the latest version of the module?
Comment #11
micahw156Thanks for the patches!
The patch in #7 basically worked for me, although I made some customizations specific to our environment.
This patch should probably verify $data[0]['snippet']['title'] is set before using it, too. I discovered the hard way that video_embed_field_handle_youtube_data() needs an API key, which we hadn't been using prior to this.
There's another iframe in this file around line 524 to embed Vimeo player. That should probably be addressed, too.
Comment #12
WebbehPushing back to Needs Work for next steps as outlined in #11:
I wonder if we should encourage an agnostic backup if the API key does not exist.
Comment #13
micahw156@webbeh, that's a good question, and possibly a new issue to update video_embed_field_handle_youtube_data(), which does not verify the key exists before making the API call.
Comment #16
wranvaud CreditAttribution: wranvaud at Phase2 commentedChanging status to needs review. Please see merge request https://git.drupalcode.org/project/video_embed_field/-/merge_requests/2.
Comment #17
micahw156+1 for the merge request from wranvaud. I was (finally) able to test these changes, and everything worked as expected.
Comment #18
wranvaud CreditAttribution: wranvaud at Phase2 commentedThank you for testing! Moving this to RTBC.
Comment #19
RobLoachThose following along for Drupal 8, the solution is over at https://www.drupal.org/project/video_embed_field/issues/3200253#comment-... .