Comments (4)
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.
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.
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.
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)
- how to control the video play or pause by html5media? HOT 2
- Does it support URL with query string? HOT 7
- IE on Windows XP no longer supported HOT 1
- Not working in IE10 -- not even on your demo page... HOT 8
- not working in ie11 If I use .wav format audio . HOT 2
- mobile video cant played (os ios) HOT 3
- html5media.js:409 Uncaught ReferenceError: DomReady is not defined HOT 2
- support lyrics? HOT 1
- there is a bug, if set video label's width "xx%" or height "xx%".it not work in IE8 HOT 1
- Can not play base64 encoded character string in src attribute? HOT 2
- Not working in IE8, when video source is a local source HOT 1
- Video can not be downloaded while playing, how to do? HOT 1
- Anyway to add playbackrate option to the controls? HOT 1
- How to get the current playback duration and set the playback progress? HOT 2
- .amr and .flv can we play with html5media HOT 5
- next version can it support m3u8? HOT 1
- We use IE7-8 browser under the environment of the HTTPS and find that html5media can't be available!!! Maybe this flash has a little problem. HOT 1
- IE7 can't use JavaScript to change the audio's volume.
- Which method to call for video play? video.play()?or html5media.play()or others
- When used as mediawiki widget, Safari browser shown fallback code requesting to download flash player ... HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html5media.