What is the state of the art for embedding audio in html4?

安稳与你 提交于 2019-12-11 20:05:42

问题


I've been trying to find a definitive modern source for the state of the art in how to embed audio, and been finding lots of up to date info on flash video, and lots of really old and questionable articles on audio embedding (e.g. with references to IE 3.0). Also haven't been able to find anything here on stackoverflow, or on doctype.

I'm writing in html4, so obviously though the html5 audio tag would be great, it's not a solution for me.

So how should audio be embedded for maximizing features and browser support?

The specific file that I'm working with is a midi type, though I don't expect that's overly important.


回答1:


In HTML4, the best thing would probably be an <object>, since <embed> was deprecated in that version. See e.g. Generic inclusion: the object element in the HTML4 specs. Something like this would suffice:

<object data="/path/to/audio.midi" type="audio/midi">
    <p>Fall-back text for browsers that can't handle the MIDI file.</p>
</object>


来源:https://stackoverflow.com/questions/3464101/what-is-the-state-of-the-art-for-embedding-audio-in-html4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!