在后台播放 SWF
一些背景:
基本上,我正在构建一个远程监控系统,该系统从运行 Web 服务器的硬件上的 XML 文件读取数据。它目前仅能够处理 html 和 cgi 请求并运行基本的 javascript。它只是没有内置 php!
除了最后一步之外,我已经完成了整个事情的设置并做我想做的事情! 当触发输入时,xml 文件会发生变化,这反过来又会使用以下内容更改网站上文本元素的颜色
document.getElementById('btn' + i).style.color = '#d00';
: i 也有一个innerHTML 随之变化:
document.getElementById('btn' + i).innerHTML = '• ALERT ' + getXMLValue(xmlData, 'inputname'+i) + '<object width="1" height="1"><param name="movie" value="http://www.upsenergy.co.uk/beep.swf"><embed src="http://www.upsenergy.co.uk/beep.swf" width="1" height="1"></embed></object>';
当触发输入时播放 swf 声音只要选择该选项卡,就可以正常工作!这意味着我必须将监控网页放在任何内容前面,并选择播放声音。
我问的是:
即使未选择选项卡,是否有办法让声音在后台播放?
这是浏览器的问题还是编码的问题?我见过无数的添加者毫无问题地解决了这个问题!
Some Background:
Basically i'm building a remote monitoring system that reads data from an XML file on a piece of hardware running a web server. Its currently only capable of html and cgi requests and runs basic javascript. Its just not got php built into it!
I have got the whole thing set up and doing what I want it to do apart from the last step now!
When an input is triggered, the xml file changes, which in turn is changing the color of an text element on the site using the
document.getElementById('btn' + i).style.color = '#d00';
i also have a innerHTML changing with this as well:
document.getElementById('btn' + i).innerHTML = '• ALERT ' + getXMLValue(xmlData, 'inputname'+i) + '<object width="1" height="1"><param name="movie" value="http://www.upsenergy.co.uk/beep.swf"><embed src="http://www.upsenergy.co.uk/beep.swf" width="1" height="1"></embed></object>';
which play the swf sound when an input is triggered which is working fine, well, as long as the tab is selected! which means i have to have the monitoring webpage in front of anything and selected to have the sound play.
What im asking is:
Is there a way of having the sound play in the background even if a tab isn't selected?
Is this a browser thing, or a coding thing? I've seen countless adds manage this with no problem at all!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论