如何检测quicktime是否安装了javascript?
我想播放声音通知,所以我使用了此处描述的方法: 跨平台、跨浏览器通过 Javascript 播放声音? 但是,当客户端计算机上未安装 Quicktime 时,每次调用 soundPlay
函数时,都会出现一个窗口弹出节目 向上。提示没有安装quicktime,建议安装。
为了用户体验,我不想在没有 Quicktime 的情况下打扰用户,如下所示:
function hasQuickTime() {
// how do I know ?
}
// play sound only if quickTime is installed
if (hasQuickTime()) {
soundPlay();
}
I want to play a sound notification, so I used the method described here: Cross-platform, cross-browser way to play sound from Javascript? However, when quicktime is not installed on the client machine, everytime the soundPlay
function is called, a windows popup shows up. It says that quicktime is not installed, and proposes to install it.
For user experience, I would like not to bother users without quicktime like this:
function hasQuickTime() {
// how do I know ?
}
// play sound only if quickTime is installed
if (hasQuickTime()) {
soundPlay();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 Apple 的 JavaScript 脚本指南:使用 JavaScript 检测 QuickTime
您可以测试变量
haveqt
是否存在 QuickTime。See Apple's JavaScript Scripting Guide: Detecting QuickTime with JavaScript
You can test the variable
haveqt
for the presence of QuickTime.