Firefox SDK:2015年播放网址中音频的正确方法? [英] Firefox SDK: correct way to play audio from the url in 2015 year?
本文介绍了Firefox SDK:2015年播放网址中音频的正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为我的插件添加功能以播放来自URL的音频.在 MDN 中,我没有找到有关此的信息.我找到了此和此和
I want to add ability to my addon to play audio from URL. At MDN I not found information about this. I found this and this and this and this answers - but this is about local file and what the correct answer for 2015 year?
推荐答案
@Noitidart未来即将到来,到2015年,您可以编写更少的代码!
@Noitidart Future is coming and at 2015 you can write much less code!
var window = require('sdk/window/utils').getMostRecentBrowserWindow();
var audio = new window.Audio('http://example.com/audio.mp3');
audio.play();
这篇关于Firefox SDK:2015年播放网址中音频的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文