在网页加载中播放MP3最简单的方法 [英] Simplest method for playing MP3 on web page load

查看:175
本文介绍了在网页加载中播放MP3最简单的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加载网页时播放MP3文件的最简单方法是什么?是否有任何方法不需要jQuery或其他大型库?

What is the most simple way to play an MP3 file when a web page is loaded? Is there any method that does not require jQuery or other sizable libraries?

推荐答案

如果您可以假设HTML5,那么只需添加一个<音频> 标记,它会播放。

If you can assume HTML5, then sure, just add an <audio> tag and it will play.

否则,你必须诉诸闪光做到这一点(理想情况下,如果html5不可用,则作为备用)。

Otherwise, you'll have to resort to flash to do it (ideally as a fallback in case html5 isn't available).

这篇关于在网页加载中播放MP3最简单的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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