我想在我的网站上实现一个音频播放器,它不是一个单页网站,由多个HTML页面组成。
我搜索了很多,发现scm音乐播放器是最好的选择。 http://scmplayer.net/
我甚至开始编码。我只是试图在一个空白的html页面中实现播放器 这是我的代码 -
<html>
<head>
</head>
<body>
Test
</body>
</html>
<script type="text/javascript" src="http://scmplayer.net/script.js"
data-config="{'skin':'skins/tunes/skin.css','volume':58,'autoplay':true,'shuffle':false,'repeat':1,'placement':'bottom','showplaylist':false,'playlist':[{'title':'Kabira (2013)','url':'https://soundcloud.com/kevin-desai-2/yeh-jawaani-hai-deewani-2013/s-KSS3w'},{'title':'Phir Muhabbat','url':'https://soundcloud.com/kevin-desai-2/phir-muhabbat-instrumental-1'},{'title':'Tum Hi ho- Aashiqui 2','url':'https://soundcloud.com/kevin-desai-2/tum-hi-ho-song-instrumental/s-tzfTz'},{'title':'Manzar Song','url':'https://soundcloud.com/kevin-desai-2/phir-muhabbat-instrumental/s-GLuGp'}]}" ></script>
我尝试将脚本标记放在任何地方,但音乐播放器不会出现。
如何让它发挥作用?
答案 0 :(得分:1)
将脚本放在开头的正文标记之后
<!DOCTYPE html>
<head>
<title>Test App</title>
</head>
<body>
Test
<script type="text/javascript" src="http://scmplayer.net/script.js" data-config="{'skin':'skins/tunes/skin.css','volume':58,'autoplay':true,'shuffle':false,'repeat':1,'placement':'bottom','showplaylist':false,'playlist':[{'title':'Kabira (2013)','url':'https://soundcloud.com/kevin-desai-2/yeh-jawaani-hai-deewani-2013/s-KSS3w'},{'title':'Phir Muhabbat','url':'https://soundcloud.com/kevin-desai-2/phir-muhabbat-instrumental-1'},{'title':'Tum Hi ho- Aashiqui 2','url':'https://soundcloud.com/kevin-desai-2/tum-hi-ho-song-instrumental/s-tzfTz'},{'title':'Manzar Song','url':'https://soundcloud.com/kevin-desai-2/phir-muhabbat-instrumental/s-GLuGp'}]}" > </script>
</body>
同时添加标题。
希望它有效。