开发者

Play more than one song in a web page

开发者 https://www.devze.com 2022-12-30 00:31 出处:网络
I\'m working on my HTML and Javascript project and I wanted to add mus开发者_运维知识库ic for the website..

I'm working on my HTML and Javascript project and I wanted to add mus开发者_运维知识库ic for the website..

Is there any way I can put more than one song in the code to be played? And is there anyway that the song will continue when openning the next page?


Without using Flash, you are bound to a new HTML5 technique <audio/>, which is supported in Firefox 3.5+, Safari 4+, Chrome 3+, and Opera 10+. Here is an example:

<audio src="path/to/some/audio.file" autoplay>  
  This is a fall back for old browsers, here you could implement a Flash based audio player
</audio>  

I'm not sure if it is possible to continue the song when opening the next page, maybe you could store player data in a cookie.


Here is a similar question with some good answers. The comments in that question list many duplicate questions as well. Many of those answers require HTML5. There are also various Flash-based answers as well.

If you want the song to continue when opening the next page you will need to use frames (easy) or make your website entirely AJAX-driven (more tedious).

0

精彩评论

暂无评论...
验证码 换一张
取 消