Giter Club home page Giter Club logo

Comments (4)

etianen avatar etianen commented on June 19, 2024

Hi,

Thanks for the report. There's certainly a way to accomplish what you're trying to do. Rather than attaching the source elements to the audio tag dynamically, try using a container element that you add complete audio elements too dynamically. Whenever you add an audio tag, call html5media() to kick in the fallback for unsupporting browsers.

Does your code work correctly in all html5-compliant browsers without including the html5media code? The reason I ask, is that I'm a bit unclear on whether an audio tag with no specified source is actually valid HTML. If it is, and your code works without error without html5media, then I'll add in this feature. If an audio tag with no source isn't valid HTML, then I'll adjust it to give a more informative error message.

The trunk version of the script handles loading audio source identically. Are you sure that you're using the complete, compiled version of the script when linking to the trunk?

from html5media.

sampsyo avatar sampsyo commented on June 19, 2024

You're absolutely right that it's not clear from the standard whether omitting the source is valid. In my experience, it seems to work in Safari, Firefox, and Chrome, but the documentation is sparse enough that it's difficult to tell whether this is intentional.

Dynamically adding/replacing the audio element does seem like the way to go in the meantime. Thanks for the idea.

from html5media.

etianen avatar etianen commented on June 19, 2024

I've updated the name of this issue.

I'm really not sure whether to make this throw an error, or just ignore media tags with no source. In the latter case, you'd still need to call html5media() to kick in the fallback player when the source has been dynamically inserted.

from html5media.

etianen avatar etianen commented on June 19, 2024

I've updated the code to fail silently if no source element could be found. This allows the code to run without errors, since this markup is probably valid.

Once source elements have been supplied, the programmer can then call html5media() to kick in the fallback;

from html5media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.