Problem/Motivation

When using the core Media module and a remote video media type, an embedded video (such as YouTube) appears normally when viewing the page. But if you turn on Safari or Firefox's 'reader' mode, the video does not appear.

Here is the iframe embed code using Drupal Core Media/oembed. Note the /media/ombed?url= before the src URL:

<iframe src="/media/oembed?url=https%3A//www.youtube.com/watch%3Fv%3DkV-T0eotrfk&amp;max_width=0&amp;max_height=0&amp;hash=U2BjybR7UaFoufcWsFloYoK5AuRHnm9xXQCY_ptCEvI" frameborder="0" allowtransparency="" width="200" height="113" class="media-oembed-content" title="Finding the Date in a Montréal Artwork's Sunrise"></iframe>

And here is a standard YouTube iframe embed code:

<iframe width="560" height="315" src="https://www.youtube.com/embed/kV-T0eotrfk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

An example from my blog: https://www.plateauastro.com/blog/2022-10-21/sunrise-tells-us-when

Steps to reproduce

1) Enable 'Media' module.
2) Ensure a 'remote video' media type is created.
3) On 'remote video' media media Manage Display, ensure Video URL format is 'oEmbed content'.
4) Add a new field, 'Reference' > 'Media' on a content type or paragraph. Select 'remote video'.
5) On new field's Manage Display, select 'Rendered Entity'.
6) Create new content using field, add YouTube URL.
7) View content, make sure YouTube video embeds correctly.
8) Turn on browser 'reader' mode and see that embedded video doesn't appear.

Is this being caused by the prepended /media/ombed?url= in the iframe src parameter?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

trevorkjorlien created an issue. See original summary.

trevorkjorlien’s picture

This related issue tries to solve it with a patch that gives an option to use the absolute URL of the video.

cilefen’s picture

Issue summary: View changes
Issue tags: -oembed, -youtube, -Accessibility

I surrounded the code blocks with the proper <code> tag.

cilefen’s picture

I do not think #3311469: Absolute path for oembed iframe is in fact related as it is about replacing only `/media/oembed` with `https://hostname.of.the.site/media/oembed`.

And, providing that full URL does not make these videos visible in Reader. That's easy to verify with browser dev tools.

trevorkjorlien’s picture

Thank you for formatting the code blocks, @cilefen.

And you could be right that the issue I linked to just prepends the hostname to /media/oembed. Thank you for looking into that.

Could there be another reason that the Reader doesn't display it? I've also noticed that my RSS Reader (NetNewsWire) also doesn't display the embedded videos.

cilefen’s picture

Assuredly there is a reason. But at least for Firefox (emphasis, mine):

Reader View is a Firefox feature that strips away clutter like buttons, ads, background images, and videos while also letting you customize the layout and theme to fit your reading preferences.

https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-we...

That seems like it works as designed.

trevorkjorlien’s picture

Good find. I did some tests with this URL which has several "normal" YouTube embeds: https://kottke.org/23/01/how-roman-roads-were-made

Safari Reader Mode: embedded videos appear

Safari YouTube Embed

NetNewsWire: embedded videos appear

NetNewsWire YouTube Embed

Firefox Reader Mode: embedded do not videos appear

Firefox YouTube Embed

This obviously isn't the place to disagree on Firefox's choice to not show video as content. But at least for Safari, Drupal's oEmbed implementation seems to fall down for some reason.

larowlan’s picture

Title: Remote oEmbed videos not appearing in Safari/Firefox 'reader' mode » Attempt to adapt Remote oEmbed videos so they appear in Safari/Firefox 'reader' mode
Category: Bug report » Feature request
Priority: Normal » Minor
Issue tags: +Bug Smash Initiative

Yeah I think this is works as designed and definitely should be a feature request, reframed as such but kept the language neutral because this may not be possible

cilefen’s picture

Version: 9.5.x-dev » 10.1.x-dev

Moved to the feature branch.

trevorkjorlien’s picture

Fair enough to put it as a feature request.

I have recommended to some vision-reduced friends to use RSS readers for accessibility reasons as it makes for a much easier reading. Not sure if that crosses the bar for this to also be an accessibility issue but thought I'd mention that.

Thanks!

cilefen’s picture

Drupal doesn't have control over browser "reader" implementations so I don't know to what extent the Drupal accessibility team can even certify something like this as complying or not complying.

If at such time there is a proposed fix that someone feels needs accessibility review, we can request that.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.