【问题标题】:mp3 files wont play on IE11 in html5 game but play in chromemp3 文件在 html5 游戏中无法在 IE11 上播放,但在 chrome 中播放
【发布时间】:2016-01-22 15:39:14
【问题描述】:

我的 js 游戏无法在 IE11 中播放我的音频文件。音频在 chrome 中运行良好。我做错了什么?

我使用 Audition 将 wav 转换为 mp3。它说它正在将它们转换为有损或无损。不知道这意味着什么。

游戏链接。 https://dev.fvtclearninginnovations.com/wisconline/arcade/games/career-clusters/agriculture-food-natural-resources/105/my-great-game

我阅读了这篇类似的帖子,并尝试了一些与我的案例相关的修复,但没有成功。 mp3 audio works in all browsers but not IE9

    var assets = [
        { id: "BackGround", src: assetsPath + "sequenceBlackBackground.png" },
        { id: "start_button", src: assetsPath + "SequencePlayButton.png" },
        { id: "clockBack", src: assetsPath + "clockBack.png" },
        { id: "clockHand", src: assetsPath + "clockHand.png" },
        { id: "levelUp", src: assetsPath + "Levelup.jpg" },
        { id: "GameOverIcon", src: assetsPath + "gameovericon.png" },
        { id: "GameOver", src: assetsPath + "GameOver.mp3" },//GameOver.ogg
        { id: "level1_Audio", src: assetsPath + "level1.mp3" },
        { id: "level2_Audio", src: assetsPath + "level1.mp3" },
        { id: "level3_Audio", src: assetsPath + "level3.mp3" },
        { id: "levelup", src: assetsPath + "level-up.mp3" },
        { id: "click", src: assetsPath + "click.mp3" }
    ];


        function playLevelAudioClip() {
            if (level == 1) {
                createjs.Sound.play("level1_Audio");
            } else if (level == 2) {
                createjs.Sound.play("level2_Audio");
            } else if (level == 3) {
                createjs.Sound.play("level3_Audio");
            }
        }

【问题讨论】:

  • 我阅读了那篇文章,但找不到可以使用的解决方案。我在看什么吗?
  • 我想是的……它仍然是重复的……我想
  • 我重新阅读了这篇文章。我在互联网选项中检查了我的播放音频框。我不知道我在上面的代码中在哪里添加了 preload="auto" 。另一篇文章谈论编辑我的 html 文档,我只是加载我的画布,没有其他代码。还是迷路了。

标签: javascript html mp3 createjs


【解决方案1】:

您能否在 IE11 Web 开发人员工具中发布控制台的输出?

同样在 IE11 本地测试 mp3 文件。右键单击该文件并使用 IE11 打开以确保该文件在浏览器中加载。

这将有助于定位问题。

【讨论】:

  • 经过一些测试,我发现它不是我的电脑的代码。该页面在其他电脑上运行良好,但不是我的。
  • 太好了。希望我能以某种方式提供帮助。
猜你喜欢
  • 1970-01-01
  • 2013-08-27
  • 2013-07-21
  • 2015-11-30
  • 2012-04-01
  • 2011-07-27
  • 1970-01-01
  • 2016-12-17
  • 1970-01-01
相关资源
最近更新 更多