Ruffle Web
For integrating Ruffle onto your PHP-Platinum website:
- Download the latest Ruffle nightly build for web.
- Put these files in your includes/ruffle-core directory on your PHP-Nuke Platinum website.
Alternatively, Ruffle is packaged with npm every release and can be included through one of the official CDN releases, such as unpkg.
You can also use a version-aliased file from jsDelivr, but only unpkg can automatically update without caching concerns.
You may then use Ruffle as a polyfill for legacy Flash embeds or use the Ruffle JavaScript API directly.
Polyfill
Ruffle will automatically replace any old-style Flash embeds on websites with Ruffle elements. This is ideal for someone looking to preserve a legacy website with a minimum amount of work. All you need to do is include the following script tag on the desired webpage:
echo "<!-- Loadiing includes/ruffle-core/ruffle.js from header.php -->"; echo '<script src="includes/ruffle-core/ruffle.js"></script>'.""; echo ' <script> window.RufflePlayer = window.RufflePlayer || {}; window.RufflePlayer.config = { "publicPath": undefined, "polyfills": true, "autoplay": "on", "unmuteOverlay": "hidden", "backgroundColor": null, "wmode": "window", "letterbox": "fullscreen", "warnOnUnsupportedContent": true, "contextMenu": true, "showSwfDownload": false, "upgradeToHttps": window.location.protocol === "https:", "maxExecutionDuration": {"secs": 15, "nanos": 0}, "logLevel": "error", "base": null, "menu": true, "salign": "", "scale": "showAll", "forceScale": false, "quality": "high", "splashScreen": false, }; </script>';
If you'd prefer to use the automatically updating CDN release, you can include the following script tag instead:
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
If you embed SWF content using JavaScript libraries such as SWFObject, then this tag should be placed as the first script tag in the <head>
, so Ruffle will be able to install its plugin spoof in time. In any other case, it's good practice to add the script before the closing </body>
tag.
Any Flash embed on the page should now be replaced with Ruffle. If Ruffle fails to load, you may need to specify the publicPath
setting: please see the Configuration Options.
Enjoy your PHP-Nuke Platinum my friends,,,
Sincerely,
Karl Childers
Data Scientist / Programmer name: Karl Childers email: Administrator[at]platinum.coders.exchange |