本文介绍了在播放器不可见的情况下自动播放带有HTML5 embed标签的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自动播放MP3音频文件,并且不想让播放器可见.

I want to autoplay a MP3 audio file and I don't want the player to be visible.

<div id="music"><embed src="Comfortably Numb.mp3" autostart=true loop=false></div>

当我使用CSS将display:none添加到音频标签时,它根本无法播放音乐.有人可以向我解释说我热衷于播放音乐而不显示播放器吗?

When I added display:none to the audio tag using css, it doesn't play the music at all.Could someone explain me hot to play the music without displaying the player?

推荐答案

或者,您可以尝试一些基本的事情来满足您的需求,

Alternatively you can try the basic thing to get your need,

<audio autoplay loop>
      <source src="johann_sebastian_bach_air.mp3">
</audio>

有关更多参考,请单击此处

这篇关于在播放器不可见的情况下自动播放带有HTML5 embed标签的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 00:51