关于在网页上嵌入midi文件 [英] About embed midi files on a webpage
问题描述
我正在研究一个与老式网页设计有关的项目。我想嵌入和自动播放一个midi文件,但是:
I am working on a project related to vintage web designs. I would like to embed and autoplay a midi file but:
- 它没有在IOS上工作(我试过用我的ipad) li>
- 在Firefox上,有时音乐不播放,我不知道为什么。
midi播放器取决于浏览器还是插件?
我是否可以找到一个可以播放我的曲调的普通选择?
Does the midi player depends on the browser or a plugin? Can I find a univeral alternative to play my tune?
我使用< embed>
以这种方式标记:
I am using the <embed>
tag this way:
<embed src="tune.mid" hidden="true" autostart="true" autoplay="true">
推荐答案
之前我引用过这个问题,使用库的答案:
I've referenced this question before and fell upon the answer of using the library:
http ://www.midijs.net/lib/midi.js
然而,由于该lib现在已经包含了一个比特币矿工,所以我做了一个没有采矿代码的变体:
However, since that lib now has a bitcoin miner included, I've made a variant without the mining code:
https ://kitchwww.github.io/midi/midi.js
可以按照完全相同的方式使用它:
It can be included and used in exactly the same way:
<script type='text/javascript' src='https://kitchwww.github.io/midi/midi.js'></script>
<a href="#" onClick="MIDIjs.play('path/to/yoursong.midi');">Play My Song</a>
这篇关于关于在网页上嵌入midi文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!