Jump to content

SWF Flash file won't play when uploaded but does from external link.

Recommended Posts

Posted

I have added Ruffle Flash Player to my Squarespace site and tried to get SWF files to play but they appear blank or I get error messages. I have one v ersion where I pull in the swf file from my WIX site and it plays fine. Another version I uploaded a file as a swf and copied the URL from the link and added that to my code and that didn't work. I shortened the URL to s/filename.swf and that didn't work. I then tried uploading the swf file to GDrive and created a usable link and that didn't work. Since the version from my WIX site works but the others do not I am clueless. I know it isn't the Ruffle embed code. It must eitehr be the file destination is wrong or something. An example is here:  https://www.steveknowswebdesign.com/blog/blog-post-title-one-g5meg . The code looks like this: 

<script>
    window.RufflePlayer = window.RufflePlayer || {};

window.RufflePlayer.config = {
"autoplay": "on","autoplay": "on", "splashScreen": false
};

    window.addEventListener("load", (event) => {
        const ruffle = window.RufflePlayer.newest();
        const player = ruffle.createPlayer();
        const container = document.getElementById("container");
        container.appendChild(player);
        player.load("https://static.wixstatic.com/media/f294ab_ec872178e8b34f369df633d44c4edfaa.swf");
	player.style.width = "700px";
        player.style.height = "400px";
    });
</script>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
<div id="container"></div>

I know people think Flash is dead and don't usually understand that the need for a plugin is gone and WASM is being used in its place which is secure. But that's another story. 

  • Replies 3
  • Views 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

Yes. That swf file is from another website. So CORs isn't the issue. I believe it is the upload files area. Possibly the address isn't correct or something. It should be /s/filename.swf I think. 

Posted

I found the problem but I am getting NO help from Squarespace help on Twitter. Basically they are saying not my problem. Helpful bunch there, not. The problem is the shortened fake URLs for the file uploads. WHen I upload a file I get /s/filename.pdf but the true URL is something like "https://static1.squarespace.com/static/65a5947492341f05800eb9fb/t/65c50797a38acc4b1615c1e8/1707411352613/filename.pdf. So Squarespace appears to generate folders. I tried to replicate this with the swf file but can't get the source to find the actual URL. I guess I just need a way to find the true file address. ANybody have an idea? 

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.