我想知道我们是否可以在没有标签的情况下以html格式制作音频。也许我们可以有用于播放和暂停的按钮,但是我仍然不知道如何控制音量等。我搜索了其他网站,但找不到答案。
谢谢,
史密斯
最佳答案
您可以使用javascript动态编辑音频的属性。
以下是功能列表:
myaudio.play(); - This will play the music.
myaudio.pause(); - This will stop the music.
myaudio.duration; - Returns the length of the music track.
myaudio.currentTime = 0; - This will rewind the audio to the beginning.
myaudio.loop = true; - This will make the audio track loop.
myaudio.muted = true; - This will mute the track
像这样有很多功能,请仔细阅读W3C上的文档。