国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

前端 - html5 audio不能播放
ringa_lee
ringa_lee 2017-04-17 14:34:07
0
2
552
ringa_lee
ringa_lee

ringa_lee

reply all(2)
巴扎黑

There is no problem with the code, please check it yourself:
1. Whether the browser supports HTML5
2. Whether the audio file path is correct and whether the audio file format is correct
3. Whether the variables conflict, etc.

劉奇

It should be a problem with your resources, I have no problem debugging locally

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var audio = document.createElement('audio');
    var source = document.createElement('source');
    audio.setAttribute('controls', 'controls');
    audio.innerHTML = "您的瀏覽器不支持 audio 標(biāo)簽。";
    source.src = './hello.mp3';
    source.setAttribute('type','audio/mpeg');

    audio.appendChild(source);
    document.body.appendChild(audio);

    window.addEventListener('click', function(){
        audio.play();
    });
  </script>
</body>
</html>

Run results: (note that the red box is not 0:00)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template