0
function audio(path2audio){
var mySound = new buzz.sound (path2audio, {
formats: ["mp3"],
preload: false,
autoplay: false,
loop: false,
volume: 70,
});
mySound.play();
}
http://buzz.jaysalvat.com/documentation/sound/
Well, I need to make a trigger called outside this function in order to stop the audio file to stop playing. My difficulty is that whenever I call the method outside the function, it shows an error: "main.js:40 Uncaught TypeError: Cannot read property 'bind' of undefined".
mySound.bind('playing', function() {
mySound.stop();
});
誰かがこれを解決するのに手伝ってもらえますか?buzz.sound関数と関数スコープの外で対話する方法は?
私の場合、jQueryの '$(document).ready(function(){'以外のグローバル変数も宣言しなければなりませんでした。 – Roger