简体   繁体   English

createjs,soundjs,preloadjs声音在Safari桌面版本9.1.3,OSX 10.11.6中不起作用

[英]createjs, soundjs, preloadjs Sound not working in Safari desktop Version 9.1.3, OSX 10.11.6

I have sound working in Chrome, Firefox on Mac, but not Safari Version 9.1.3, OSX 10.11.6. 我在Chrome,Mac上的Firefox上可以正常运行,但在Safari版本9.1.3,OSX 10.11.6上却无法正常运行。

I can only find a statement in the docs saying that Safari will need the Quicktime plugin. 我只能在文档中找到一条声明,指出Safari将需要Quicktime插件。 However, when I point my Safari to the Soundjs and Preloadjs demo pages, the sound works fine in the demos. 但是,当我将Safari指向Soundjs和Preloadjs演示页面时,声音在演示中正常运行。 Furthermore, apparently Apple is no longer including the QT plugin on current installs of Safari. 此外,显然,Apple在当前安装的Safari中不再包括QT插件。 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) (编辑:刚收到的单词声音在MS Edge中也不起作用)

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
        }
    );
});

It was a simple file format issue. 这是一个简单的文件格式问题。 Outside the scope of createjs's documents to inform me about. 超出了createjs文档范围的通知。 Shame on me :( 真可惜:(

OGG is no bueno in Safari and Exploder. OGG在Safari和Exploder中不是布宜诺斯艾利斯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM