Reputation: 53
I have sound working in Chrome, Firefox on Mac, but not Safari Version 9.1.3, OSX 10.11.6.
I can only find a statement in the docs saying that Safari will need the Quicktime plugin. However, when I point my Safari to the Soundjs and Preloadjs demo pages, the sound works fine in the demos. Furthermore, apparently Apple is no longer including the QT plugin on current installs of Safari. It would be unacceptable to ask users to install a legacy plugin. (edit: just received word the sound isn't working in MS Edge either)
Here is all of my code:
var stage;
var canvas;
canvas = document.getElementById("gamezCanvas");
stage = new createjs.Stage(canvas);
var soundsManifest = [
{
id: 0, src: '10_ciiruhi.ogg'
},
{
id: 1, src: '20_shuuk.ogg'
}
];
var queue = new createjs.LoadQueue();
queue.installPlugin(createjs.Sound);
queue.on("complete", handleComplete);
queue.loadManifest(soundsManifest, true, audio_url);
function handleComplete() {
createjs.Sound.play(1,
{
interrupt: createjs.Sound.INTERRUPT_NONE,
loop: 0,
volume: 1
}
);
}
var btn = new createjs.Shape();
btn.graphics.beginFill("#000");
btn.graphics.drawRect(0, 0, 200, 120);
stage.addChild(btn);
stage.update();
btn.on("click", function() {
createjs.Sound.play(0,
{
interrupt: createjs.Sound.INTERRUPT_NONE,
loop: 0,
volume: 1
}
);
});
Upvotes: 0
Views: 556
Reputation: 53
It was a simple file format issue. Outside the scope of createjs's documents to inform me about. Shame on me :(
OGG is no bueno in Safari and Exploder.
Upvotes: 2