GET http:// localhost:8100 / net :: ERR_CACHE_READ_FAILURE

时间:2016-01-25 10:53:57

标签: javascript html5 cordova ionic-framework

我得到以下Chrome错误大约20次:

  

GET http :: // localhost:8100 / video / ping.mp3 net :: ERR_CACHE_READ_FAILURE

如果条形码扫描正确,我会尝试更换div。我将HTML5音频标签嵌入到我的替代品中。如果条形码正确,当用户点击将激活的按钮时,应该更换div容器 - *这是有效的,但音频没有播放,我得到上面的错误。

我的错误是什么?

任何帮助非常感谢

我有这段代码:

var mp = document.getElementById("mp3");
function play() {
mp.play();
}
    function scan() {
      cordova.plugins.barcodeScanner.scan(
        function(result) {
          if (result.text == "home") {
            var atHomeRepQR = '<div class="container-h"><div class="card"><div class="item item-text-wrap "><i class="icon ion-unlocked"></i> Diese Ansicht ist entsperrt.</div></div><button onclick="play()" class="button button-positive btn">Play</button></div><audio id="mp3"><source src="video/ping.mp3" type="audio/mpeg"></audio>';
            save("atHomeSaveQR", atHomeRepQR);
          }
          if (result.text == "street") {
            var atStreetRepQR = '<div class="container-s"><div class="card"><div class="item item-text-wrap "><i class="icon ion-unlocked"></i> Diese Ansicht ist entsperrt.</div></div><button onclick="play()" class="button button-positive btn">Play</button></div><audio id="mp3"><source src="video/ping.mp3" type="audio/mpeg"></audio>';
            save("atStreetSaveQR", atStreetRepQR);
          }
          if (result.text == "bern") {
            var atBernRepQR = '<div class="container-b"><div class="card"><div class="item item-text-wrap "><i class="icon ion-unlocked"></i> Diese Ansicht ist entsperrt.</div></div><button onclick="play()" class="button button-positive btn">Play</button></div><audio id="mp3"><source src="video/ping.mp3" type="audio/mpeg"></audio>';
            save("atBernSaveQR", atBernRepQR);
          }
          if (result.text == "bahnhof") {
            var atBahnhofRepQR = '<div class="container-ba"><div class="card"><div class="item item-text-wrap "><i class="icon ion-unlocked"></i> Diese Ansicht ist entsperrt.</div></div><button onclick="play()" class="button button-positive btn">Play</button></div><audio id="mp3"><source src="video/ping.mp3" type="audio/mpeg"></audio>';
            save("atBahnhofSaveQR", atBahnhofRepQR);
          }
          if (result.text == "atelier") {
            var atAtelierRepQR = '<div class="container-at"><div class="card"><div class="item item-text-wrap "><i class="icon ion-unlocked"></i> Diese Ansicht ist entsperrt.</div></div><button onclick="play()" class="button button-positive btn">Play</button></div><audio id="mp3"><source src="video/ping.mp3" type="audio/mpeg"></audio>';
            save("atAtelierSaveQR", atAtelierRepQR);
          }

        },
        function(error) {
          alert("Scanning failed: " + error);
        }
      );
    }

0 个答案:

没有答案