Problem/Motivation

Responsive video styles that use Multiple sources in one video build their <source> list from the configured breakpoint mappings and fallback video styles.

When a provider derivative is not ready yet, some video style providers correctly fall back to the original Drupal-managed file. However, the responsive source builder currently compares fallback URLs as raw strings. If equivalent local file URLs are returned in different formats, such as relative and absolute URLs, the builder does not recognize them as the same local fallback.

This can lead to duplicate <source> tags for the exact same file, especially when provider-backed derivatives are unavailable.

Steps to reproduce

  1. Install responsive_video_style together with a provider-backed video_style module.
  2. Create a responsive video style using Multiple sources in one video.
  3. Configure mapped and fallback video styles that use the provider module.
  4. Render a video while the provider derivatives are not ready yet, or while the provider runtime configuration is missing so the provider falls back to the original local file.
  5. Inspect the rendered HTML.
  6. Observe that the <video> element may contain multiple duplicate <source> tags pointing to the same Drupal file.

Proposed resolution

Normalize local fallback detection in the responsive source builder so that Drupal-managed fallback URLs are treated as equivalent even if they are returned in different formats.

Expected behavior:

  • If a provider derivative falls back to the original Drupal-managed local file, it should not be rendered as a breakpoint- or fallback-specific provider source.
  • The source-strategy renderer should emit only one shared local fallback <source> entry for that file.
  • Remote provider URLs should remain unchanged.

This keeps the rendered markup correct and avoids duplicate source entries when provider-backed derivatives are unavailable.

Remaining tasks

  • Normalize local fallback URL handling in the responsive source builder.
  • Ensure equivalent local fallback URLs are recognized even when one form is relative and the other is absolute.
  • Verify that only one local fallback <source> remains when provider derivatives are unavailable.

User interface changes

No.

This issue changes frontend-rendered video markup only.

API changes

No.

This issue changes internal responsive rendering behavior only.

Data model changes

No.

This issue does not change configuration, schema, or stored data.

Comments

dpacassi created an issue. See original summary.

  • dpacassi committed 8959a2ff on 1.0.x
    Issue #3587332 by dpacassi: Avoid duplicate local fallback sources when...
dpacassi’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.