【问题标题】:Is it possible to use Ruffle within an Iframe?是否可以在 iframe 中使用 Ruffle?
【发布时间】:2021-07-17 00:24:41
【问题描述】:

所以我一直在尝试在一个网站上使用 Ruffle(一个用 Rust 编写的 Flash 模拟器)来开发一些 Flash 游戏。这就像我的网站源文件中的 Flash 游戏的魅力,但它不适用于 iframe。这是我一直试图开始工作的代码,但此时我不确定它是否可能。有什么帮助吗?

<script src="ruffle/ruffle.js"></script>
<iframe id="cppscreatorCPPS" src="https://play.cppscreator.xyz/embed/24436" scrolling="no" width="960" height="600" frameborder=0></iframe>
<br /><br />```

【问题讨论】:

  • 不,这是与 ruffle EXTENSION 相关的问题,而不是与网站自托管的 ruffle 相关的问题。无论如何,它也可能已经过时了,因为它是从去年开始的,而且因为 ruffle 有夜间构建,我想这早就被淘汰了。
  • 好吧,那么另一种可能。很久以前,我在 Flash 中处理外部资源,发现 Flash(或者更确切地说,代表 Flash 插件的浏览器)将相对 URL 视为相对于顶部文档位置(而不是承载 Flash 应用程序或主 SWF 文件的页面)。您可能想要打开您正在使用的任何 Web 控制台并监控来自 iframe 的资源请求。

标签: html github flash iframe ruffle


【解决方案1】:

我建议您使用&lt;object&gt;&lt;embed&gt;组件,而不是&lt;iframe&gt;。我将在下面留下一个代码 sn-p (您需要将嵌入的 paramsrc 的值替换为您的 swf 文件链接。在您的情况下,它是 play.cppscreator.xyz/embed 链接. ).另外,您正在使用 cppscreator.xyz,它实际上不是一个 SWF 文件。

<script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
<object width="600" height="400">
    <param name="movie" value="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    <embed src="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    </embed>
</object>

【讨论】:

    猜你喜欢
    • 2021-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-11
    • 2011-08-12
    • 2011-02-17
    • 2017-04-16
    • 2011-01-19
    相关资源
    最近更新 更多