小编Thu*_*ole的帖子

如何将 Ruffle flash 播放器模拟器嵌入到 HTML 文件中?

我需要帮助使用 ruffle ( https://ruffle.rs/ )将 swf 实现到我的 HTML 站点中,我将“AddType application/wasm .wasm”添加到 apache 中的 httpd.conf 中,这是我的代码,但它确实如此不显示在我的本地主机服务器上:

<html><head><script src="ruffle/ruffle.js"></script>
</head>
<body>
<script>
    window.RufflePlayer = window.RufflePlayer || {};
    window.addEventListener("load", (event) => {
        const ruffle = window.RufflePlayer.newest();
        const player = ruffle.createPlayer();
        const container = document.getElementById("container");
        container.appendChild(player);
        player.load("mig29.swf");
    });
</script>
<script src="ruffle/ruffle.js"></script>

</body>
</html
Run Code Online (Sandbox Code Playgroud)

我也尝试过这段代码,也没有运气:

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>WORKAROUND</title>

    <script>
        window.RufflePlayer = window.RufflePlayer || {};
        window.RufflePlayer.config = {
            "public_path": "ruffle/",
            "polyfills": ["static-content", "plugin-detect", "dynamic-content"]
        };
    </script>
    <script src="ruffle/ruffle.js"></script>

    <!-- Start workaround …
Run Code Online (Sandbox Code Playgroud)

flash emulation ruffle

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

emulation ×1

flash ×1

ruffle ×1