title: How to embed Ruffle flash player emulator into HTML file?
body: <p>I need help on implementing a swf into my HTML site with ruffle (<a href="https://ruffle.rs/" rel="nofollow noreferrer">https://ruffle.rs/</a>), I added &quot;AddType application/wasm .wasm&quot; into httpd.conf in  in apache, and this is my code but it does not display on my localhost server :</p>
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;script src=&quot;ruffle/ruffle.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
      window.RufflePlayer = window.RufflePlayer || {};
      window.addEventListener(&quot;load&quot;, (event) =&gt; {
          const ruffle = window.RufflePlayer.newest();
          const player = ruffle.createPlayer();
          const container = document.getElementById(&quot;container&quot;);
          container.appendChild(player);
          player.load(&quot;mig29.swf&quot;);
      });
  &lt;/script&gt;
  &lt;script src=&quot;ruffle/ruffle.js&quot;&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html
  </code></pre>
  <p>I also tried this code, also no luck:</p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;utf-8&quot; /&gt;
      &lt;title&gt;WORKAROUND&lt;/title&gt;
  
      &lt;script&gt;
          window.RufflePlayer = window.RufflePlayer || {};
          window.RufflePlayer.config = {
              &quot;public_path&quot;: &quot;ruffle/&quot;,
              &quot;polyfills&quot;: [&quot;static-content&quot;, &quot;plugin-detect&quot;, &quot;dynamic-content&quot;]
          };
      &lt;/script&gt;
      &lt;script src=&quot;ruffle/ruffle.js&quot;&gt;&lt;/script&gt;
  
      &lt;!-- Start workaround --&gt;
      &lt;script&gt;
          const swfobject = {};
      &lt;/script&gt;
      &lt;script&gt;
          Object.defineProperty(swfobject, &quot;embedSWF&quot;, {
              value: function() {
                  var ruffle = window.RufflePlayer.newest();
                  var player = ruffle.create_player();
                  var container = document.getElementById(arguments[1]);
                  container.innerHTML = &quot;&quot;;
                  container.style.width = arguments[2] + &quot;px&quot;;
                  container.style.height = arguments[3] + &quot;px&quot;;
                  player.style.width = container.style.width;
                  player.style.height = container.style.height;
                  container.appendChild(player);
                  player.stream_swf_url(arguments[0]);
              },
              writable: false,
              configurable: false
          });
      &lt;/script&gt;
      &lt;!-- End workaround - This code also works if placed before &lt;swfobject.js&gt; --&gt;
  
      &lt;script src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id=&quot;file_div&quot;&gt;Flash Player not detected!&lt;/div&gt;
  &lt;script&gt;
      swfobject.embedSWF(&quot;mig29.swf&quot;, &quot;file_div&quot;, &quot;550&quot;, &quot;400&quot;, &quot;8&quot;);
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I asked their discord but no answer so far. If anyone is more familiar with ruffle please assist.</p>