使用 jQuery Mobile 播放音频

发布于 2024-12-29 13:23:38 字数 132 浏览 2 评论 0 原文

使用 HTML5 和 jQuery Mobile 我有一个带有 3 个按钮的页面。

我想要做的是让每个按钮选择不同的声音,然后使用另一个按钮来播放所选的声音。

有人可以给我指导吗?

谢谢吉姆

Using HTML5 and jQuery Mobile I have a page with 3 buttons.

What I want to do is have each button select a different sound, then have another button to play the selected sound.

Can anyone give me a steer?

Thanks

Jim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿咻 2025-01-05 13:23:38

查看 HTML5 标签。您可以预加载音频剪辑并在用户与元素交互时播放它们。

的文档:https://developer.mozilla .org/en/HTML/Element/audio

您可能想为此检查一个预制插件,我已经看到 JPlayer 使用了很多:http://jplayer.org/

虽然插件不是必需的,但 HTML5 标签具有使用 JavaScript 控制它的能力。

Check-out the HTML5 <audio> tag. You can pre-load audio clips and play them when the user interacts with elements.

Docs for <audio>: https://developer.mozilla.org/en/HTML/Element/audio

You may want to check-out a pre-made plugin for this, I have seen JPlayer used a lot: http://jplayer.org/

Although a plugin will not be necessary, the HTML5 <audio> tag comes with the ability to control it using JavaScript.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文