gpt4 book ai didi

html - 如何为嵌入音频添加控件?

转载 作者:行者123 更新时间:2023-12-03 01:56:44 26 4
gpt4 key购买 nike

我在网站上添加了一些音乐,这些音乐会在您加载时开始播放。我也想提供暂停/取消暂停的选项。我该怎么做才能添加控件?

<embed controls autostart="true" height="0" loop="true" src="URL://music-file" width="0" />

最佳答案

使用HTML5

一种简单的方法是使用HTML5及其音频标签。

<audio controls autoplay>
<source src="MP3 PATH" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

关于html - 如何为嵌入音频添加控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34709038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com