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
- Install
responsive_video_styletogether with a provider-backedvideo_stylemodule. - Create a responsive video style using
Multiple sources in one video. - Configure mapped and fallback video styles that use the provider module.
- 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.
- Inspect the rendered HTML.
- 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
Comment #3
dpacassi