3

I made some simple .swf object (Actionscript 2) and wrapped it with Ruffle:

http://www.tanadsplinare.com.hr/test1/3.htm

Here's the complete code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
</head>
<body>
<div id="container"></div>
</body>
</html>
<script>
    var file = '3';
    window.RufflePlayer = window.RufflePlayer || {};
    window.addEventListener("DOMContentLoaded", function() {
        var ruffle = window.RufflePlayer.newest();
        var player = ruffle.createPlayer();
        var container = document.getElementById("container");
        container.appendChild(player);
        player.load(file + '.swf');
    });
</script>
<script src="ruffle.js"></script>

I can open it in FF and Chrome on PC/Laptop (however, Chrome is displaying the play button at first, but that's another issue, I guess I could overcome it).

But I failed to open it on my Android phone using Chrome. I know Ruffle is supported on mobile browsers, because I've opened already sites like: https://www.albinoblacksheep.com/games/bloxorz

Here are some variations, also not working: Same thing, but scripts moved within body tag: http://www.tanadsplinare.com.hr/test1/ruffle1.htm DOMContentLoaded event fires as it should, and I proved it with an alert.

Take 2: Flash object and just ruffle plugin (according to documentation, this is enough. And yes, this works on FF and Chrome, but not in mobile Chrome) http://www.tanadsplinare.com.hr/test1/ruffle2.htm

Even more like Bloxorz: Flash object, configuring ruffle (like Bloxorz did) and ruffle plugin. And yes, this works on FF and Chrome, but not in mobile Chrome) http://www.tanadsplinare.com.hr/test1/ruffle3.htm

All possible listed variations work fine on PC/Laptop browsers, but not on mobile (Xaomi Redmi 6, Android, Chrome)

Dalibor
  • 1,430
  • 18
  • 42
  • There are differences between your script and the **bloxorz**. 1. Yours is out of **** tag, the other one is inside the ****. I'd test if this works on mobile at all. 2. Your script relies on some event. Did you, prior to posting, test if your event handler executes? – Organis Jul 13 '21 at 20:22
  • Yes, event handler executes, also in mobile Chrome. I edited my answer, added 3 additional examples - iterations, one of them almost identical to Bloxorz. – Dalibor Jul 14 '21 at 21:28
  • @Dalibor Just adding that according to the [Can I Use...](https://caniuse.com/mdn-html_elements_applet_object) website the `` tag is not supported on Chrome for Android. I'm not sure how Bloxorz are using it on mobile (I've not tested their site on an Android device)... As a test I would **(1)** First copy their `` HTML to your site, does it still run the Bloxorz game? If yes then **(2)** Replace their SWF link with your own SWF link... If it fails now then maybe the problem is your SWF file (or Bloxorz has an HTML5 fallback, meaning it's not showing SWF but some JS game code) – VC.One Jul 18 '21 at 10:46
  • I'm not sure what you suggesting - the Ruffle library works in a way to replace `object` with their custom HTML tag `ruffle-object`, you can see it if you inspect DOM – Dalibor Jul 18 '21 at 10:57
  • 1
    However, I did find the solution - it was Ruffle latest SDK that is buggy when it comes to Android Chrome version - or vice versa - so I'm experimenting with Publishing it with particular Flash player versions. – Dalibor Jul 18 '21 at 11:04
  • 1
    @Dalibor **(1)** Ahh I did not inspect any DOM just went straight to viewing source code. On Bloxorz they use Object tag see line 630. If Ruffle is detecting it in the HTML and outputting its own replacement then that's cool. **(2)** For some reason your answer wasnt visible when I wrote my comment (now after refresh I see you answered 15 hours ago, wtf indeed)... +1 for solving it. – VC.One Jul 18 '21 at 12:20

1 Answers1

1

The thing is as I found out in Ruffle forum, this latest version of Ruffle SDK is not so well handled in Chrome 91 on Android, and should be in future update of Chrome 92.

Therefore, I used SDK from the site I noticed that Ruffle/Flash objects were working OK (turns out it was Ruffle ver from January):

https://www.albinoblacksheep.com/script/ruffle_nightly_2021_01_26_selfhosted/aafdd926c74ff1ff1e03a02091c0405b.wasm https://www.albinoblacksheep.com/script/ruffle_nightly_2021_01_26_selfhosted/ruffle.js

I imported in my site and it works (almost) fine.

Dalibor
  • 1,430
  • 18
  • 42