HTML:播放没有控件的音频? [英] Html: play audio without controls?

查看:81
本文介绍了HTML:播放没有控件的音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户单击图像时,我需要播放mp3音频文件.我只想播放音频,即应该没有控件,小部件等,浏览器也不应启动外部应用程序.

I need to play a mp3 audio file when the user clicks on a image. I only want to audio to play, i.e. there should be no controls, widgets, etc. Nor should the browser launch an external application.

好的,我也许可以尝试使用Flash.轻量级Flash播放器有什么建议?

推荐答案

您可以执行以下操作:

<embed src="blah.wav" autostart=false loop=false>

...但是播放没有闪光灯的声音是有害的,即使存在一些

... but playing sound without flash is evil and will lead to issues cross browser even if there is some solutions.

您还可以使用HTML5和音频标签:

You could also use HTML5 and the audio tag:

<audio src="horse.ogg" controls="controls">
Your browser does not support the audio element.
</audio>

...但是并非所有浏览器都支持.

... but this won't be supported by all browsers.

对于Flash播放器,您可以使用

For a flash player you could use this one or this very simple one... there are tons! Try out examples and see what's best for you.

这篇关于HTML:播放没有控件的音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆