都没问题怎么会不能播放呢
1.代码问题
2.adobe flash player有问题
随便在网上找个flash游戏 如果不能玩说明是播放器插件的问题 如果可以
我只能说是代码问题
我刚刚自己写了几行代码 放了十几个播放器 可以放啊 我的代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
<embed src="music/安静了.mp3" autostart="true" loop="true" width="290" height="45" volume="100" controls="console"></br>
</body>
</html>
把autostart设置为false为默认停止播放 为true设置为默认播放
<!Doctype html><html>
<head>
<meta charset="utf-8">
<title>MUSIC</title>
<style type="text/css">
*{margin:0pxpadding:0px}
#bg{position:absolutetop:0pxleft:0pxbackground:url("./img/bg_1.jpg")background-size:coverheight:100%width:100%overflow:hidden}
#music_icon{position:fixedtop:10pxright:10pxbackground:url("./img/music_icon.png")background-size:coverheight:55pxwidth:55px}
#music_board{height:500pxwidth:400pxbackground:#999margin:10% autoborder-radius:12pxbox-shadow:0px 0px 15px #222display:none}
#music_gif{height:280pxwidth:380pxposition:relativetop:20pxleft:10pxbackground:url("./img/music_5.gif")background-size:cover}
#music_control{text-align: centerposition: relativetop: 50pxcolor: rgb(255, 255, 255)font-size: 1.5em}
#control{margin-top:45pxwidth:100%height:70pxtext-align:center}
</style>
</head>
<body>
<audio id="music" src="./mp3/xinxiangan.mp3" loop="loop"></audio>
<div id="bg">
<div id="music_icon" onclick="show_music_board()"></div>
<div id="music_board">
<div id="music_gif"></div>
<div id="music_control">MUSIC BOARD
<div id="control">
<img id="control_img" src="./img/pause_button.png" height="60px" onclick="music_control()">
</div>
</div>
</div>
</div>
<script type="text/javascript">
var music = document.getElementById("music")//建立audiod对象
var control_img = document.getElementById("control_img")//建立播放按钮图片对象,为了更好的操作
var music_board = document.getElementById("music_board")//建立music面板的对象,为了更好的操作
var lock = false//设置一个布尔变量,用于判断音乐的播放与暂停
function music_control(){//音乐开始与暂停
if( lock == false){
music.play()
control_img.setAttribute("src", "./img/pause_button.png")
lock = true
}
else{
music.pause()
control_img.setAttribute("src", "./img/play_button.png")
lock = false
}
}
function show_music_board(){//music面板的显现与展示
if( music_board.style.display == "none"){music_board.style.display = "block"
lock = false
music_control()
}
else{
music_board.style.display ="none"
lock = true
music_control()
}
}
</script>
</body>
</html>