Skip to main content

Embedding RemixWarp Projects

RemixWarp provides powerful embedding capabilities that allow you to integrate projects into websites, applications, and other platforms with enhanced features and customization options.

Basic Embedding​

Simple iframe Embedding​

The easiest way to embed a RemixWarp project:

<iframe
src="https://remixwarp.pages.dev/414716080/embed"
width="480"
height="360"
frameborder="0"
scrolling="no"
allowfullscreen>
</iframe>

Replace 414716080 with your project ID and adjust URL parameters as needed.

Enhanced Embedding​

Supported embed parameters include autoplay, addons, and standard runtime options like turbo, fps, hqpen, interpolate, and size:

<iframe
src="https://remixwarp.pages.dev/414716080/embed?autoplay&turbo&fps=60"
width="800"
height="600"
frameborder="0"
scrolling="no"
allowfullscreen>
</iframe>

Embedding Parameters​

Basic Parameters​

ParameterValuesDescription
autoplaybooleanAuto-start project on load
usernamestringSet username used by blocks
turbobooleanEnable turbo mode

Display Parameters​

ParameterValuesDescription
fpsnumberSet frame rate
hqpenbooleanHigh quality pen rendering
sizeWIDTHxHEIGHTCustom stage dimensions
interpolatebooleanEnable motion interpolation

Embed-Specific Parameters​

ParameterValuesDescription
addonscomma listEnable specific addons (eg. pause,gamepad)
settings-buttonbooleanShow settings button in player header
fullscreen-backgroundCSS colorFullscreen background color override

Advanced Embedding​

Responsive Embedding​

Create responsive embeds that adapt to container size:

<div style="position: relative; padding-bottom: 75%; height: 0;">
<iframe
src="https://remixwarp.pages.dev/414716080/embed"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
frameborder="0"
allowfullscreen>
</iframe>
</div>

Custom Theming​

Theme and accent are not controlled by URL parameters in embeds. Use CSS around the iframe or the Packager for theme control.

JavaScript API Integration​

PostMessage Communication​

Embeds accept LOAD_SB3 messages for loading projects. See detailed guide: /user-guide/embed-messaging.

// Send SB3 to the embed (URL or binary)
const iframe = document.getElementById('remixwarp-embed');
iframe.contentWindow.postMessage({
type: 'LOAD_SB3',
data: 'https://remixwarp.pages.dev/414716080/embed',
title: 'Optional Title'
}, '*');

// Receive load response
window.addEventListener('message', (event) => {
if (event.data && event.data.type === 'LOAD_SB3_RESPONSE') {
console.log(event.data.status, event.data.message);
}
});

Event Handling​

Embeds do not emit general project events via postMessage. Use the VM API within the embed context if you need state.

Packager Integration​

Standalone Embeds​

Use the 02Engine Packager for standalone embeds:

  1. Visit packager.02engine.org
  2. Enter your project URL or upload project file
  3. Configure embedding options
  4. Download generated HTML file

Self-Hosted Embeds​

Host projects on your own server:

<!-- Self-hosted project -->
<iframe
src="/path/to/your/project.html"
width="480"
height="360">
</iframe>

Embedding Best Practices​

Performance Optimization​

Lazy Loading​

Load embeds only when needed:

// Intersection Observer for lazy loading
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const iframe = entry.target;
iframe.src = iframe.dataset.src;
observer.unobserve(iframe);
}
});
});

document.querySelectorAll('iframe[data-src]').forEach(iframe => {
observer.observe(iframe);
});

Preloading​

Preload critical resources:

<link rel="preload" href="https://remixwarp.pages.dev/" as="document">
<link rel="preconnect" href="https://remixwarp.pages.dev">

Accessibility​

Screen Reader Support​

Provide alternative content for screen readers:

<iframe
src="https://remixwarp.pages.dev/414716080/embed"
title="Interactive Math Game - Practice Addition and Subtraction"
aria-label="Scratch game for practicing math skills">
<p>This is an interactive math game that helps practice addition and subtraction.
If you cannot access the game, please <a href="/alternative-math-practice">
try our alternative version</a>.</p>
</iframe>

Keyboard Navigation​

Ensure embedded projects support keyboard navigation by focusing the iframe or providing external controls.

Security Considerations​

Content Security Policy​

Configure CSP headers for embedded content:

Content-Security-Policy: frame-src https://remixwarp.pages.dev

Sandbox Attributes​

Use sandbox attributes for additional security:

<iframe
src="https://remixwarp.pages.dev/414716080/embed"
sandbox="allow-scripts allow-same-origin allow-fullscreen">
</iframe>

Platform-Specific Embedding​

WordPress​

Use WordPress shortcodes or embed blocks:

// Custom shortcode for RemixWarp embeds
function remixwarp_embed_shortcode($atts) {
$atts = shortcode_atts([
'id' => '',
'width' => 480,
'height' => 360,
'autoplay' => false,
'turbo' => false
], $atts);

$src = "https://remixwarp.pages.dev/" . $atts['id'] . "/embed";
if ($atts['autoplay']) $src .= "?autoplay";
if ($atts['turbo']) $src .= $atts['autoplay'] ? "&turbo" : "?turbo";

return "<iframe src='{$src}' width='{$atts['width']}' height='{$atts['height']}' frameborder='0'></iframe>";
}
add_shortcode('remixwarp', 'remixwarp_embed_shortcode');

React/Vue.js​

Create reusable components:

// React component
import React from 'react';

const RemixWarpEmbed = ({
projectId,
width = 480,
height = 360,
autoplay = false,
turbo = false
}) => {
const params = new URLSearchParams();
if (autoplay) params.append('autoplay', '');
if (turbo) params.append('turbo', '');

const src = `https://remixwarp.pages.dev/${projectId}/embed?${params}`;

return (
<iframe
src={src}
width={width}
height={height}
frameBorder="0"
allowFullScreen
/>
);
};

export default RemixWarpEmbed;

Troubleshooting Embedding​

Common Issues​

Project Not Loading​

  • Check project ID is correct
  • Verify project is shared publicly
  • Check network connectivity
  • Try different embedding parameters

Performance Issues​

  • Enable turbo mode: ?turbo
  • Reduce frame rate if needed: ?fps=30
  • Check browser compatibility
  • Monitor memory usage

Display Problems​

  • Verify iframe dimensions
  • Check CSS conflicts
  • Test responsive behavior
  • Validate HTML structure

Debugging​

Use the browser devtools console and network inspector. There is no debug URL parameter.

RemixWarp's embedding capabilities make it easy to integrate interactive content into any website or application. Use these features to create engaging, interactive experiences for your users!