question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transition back to nested source elements

See original GitHub issue

See thread in #5 for more information.

As @mikkoh points out, <video> is a good parallel with <model-viewer>, and the precedent set on that tag is to allow a set of nested <source> tags (with optional specification of mime types). Being in line with that allow us to avoid some overly specific names (like our current ios-src), support additional types easily in the future, and be inline with other tags.

Specifically, I believe we should:

  • Support nested <source> elements, with required src and optional type attributes
  • Remove the ios-src attribute (or deprecate it, moving towards a future removal)
  • Leave the src attribute as an easy fallback (this is in line with other elements)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
mikkohcommented, May 10, 2019

I’m cool using <source> if everyone else is 😂

1reaction
cdatacommented, Apr 8, 2019

Excellent question @mrdoob . From the embedded content section of the HTML5 spec:

There are three ways to specify a media resource, the srcObject IDL attribute, the src content attribute, and source elements. The IDL attribute takes priority, followed by the content attribute, followed by the elements.

From the sounds of things, the attribute always takes precedence. Another interesting tidbit is this:

If a src attribute of a media element is set or changed, the user agent must invoke the media element’s media element load algorithm. (Removing the src attribute does not do this, even if there are source elements present.)

This suggests two important things:

  1. No matter what, if src is set to null (e.g., the attribute is removed), nothing should be loaded
  2. <source> element URLs should not be considered fallbacks when the src attribute is removed / set to null

From elsewhere in the spec, it also has this to say about <source> elements:

Dynamically modifying a source element and its attribute when the element is already inserted in a video or audio element will have no effect. To change what is playing, just use the src attribute on the media element directly… Generally, manipulating source elements manually after the document has been parsed is an unnecessarily complicated approach.

This is a very helpful simplification of the problem. Otherwise, we would have to create a MutationObserver just to know when the src attribute on the <source> elements has changed in a meaningful way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Transition of nested shared elements does not starts ...
I've debugged and shared elements have the same names in the source and destination. The Question (Again). Why this transition does not start ......
Read more >
Edit from sequences loaded into the Source Monitor
Edit from sequences loaded into the Source Monitor ... is a nested sequence, containing its own series of clips, transitions, and effects.
Read more >
Nested Scenes in OBS - Advanced OBS Tips & Tricks - YouTube
22.6K/50K In today's video, Chad talks about Nested Scenes in OBS. He covers what scene nesting is, when to use scene nesting, and...
Read more >
How to Nest and Un-Nest Sequences in Premiere Pro
Find out how to Nest and Un-Nest sequences in Premiere Pro with the help of this video. COURSES (HOSTED ON SKILLSHARE)» After Effects: ......
Read more >
Components Basics - Vue.js
It's common for an app to be organized into a tree of nested components: ... native <template> elements) - Vue will use its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found