Single File HTML Playable: Why Networks Want It Inline
Some ad networks ask for a playable as one HTML file with every asset embedded. Here is why they do it, what it costs you, and how to build and test one without surprises.
Key takeaways - A single file HTML playable carries its code, styles, images, audio and data inside one HTML document, with no outside requests at load time. - Networks ask for this because one file is simpler to store, scan, deliver through an SDK and render reliably in a webview. - Inlining changes your build: binary assets become text, the file grows, and any code that fetches local files or remote resources will break. - Treat the network's current spec as the source of truth. Some accept a ZIP, some want one file, and the rules change. - Test the final built file with your connection off. It is the fastest way to find hidden dependencies.
What "single file" actually means
A single-file playable is one HTML document. The CSS sits in a style block in that document. The JavaScript sits in a script block. Images, sprites, audio and fonts are embedded as text, usually as data URIs encoded in Base64. Level data and config are plain JSON inside the script.
When the ad loads, the device reads the file and has everything it needs. It makes no further requests for assets, so nothing can be missing.
This is different from the ZIP model, where an index.html references separate files in folders. A ZIP can be fully self-contained too, because it needs nothing from the internet. But it relies on the network unpacking it and serving the files with their paths intact. A single file removes that dependency.
Why some networks want everything inline
Networks rarely explain their reasons in detail, but the logic is easy to reconstruct from how playables are served.
One object is easier to handle
A playable passes through many systems: upload, review, storage, auction, delivery, an SDK, and finally a webview on a phone. Each handoff is simpler when the creative is a single string. There is no folder structure to preserve, no path rewriting, and no partial upload where one image went missing.
Relative paths break in odd places
Inside an SDK, the ad is often loaded from a string or a local container rather than from a normal web address. A relative path like assets/hero.png may then point nowhere. Inline assets cannot have that problem, because they are part of the document.
Fewer requests means fewer ways to fail
Every extra request is a chance for a slow connection, a timeout or a blocked host. Players give an ad only a moment before deciding whether to engage. A playable that is still fetching a sprite sheet when the impression starts looks broken. With everything inline, the only wait is the file itself.
Review and security are simpler
Networks check playables for unwanted network calls, unapproved tracking, and behavior that escapes the ad container. Reviewing one file is more tractable than reviewing a tree of files, and a policy such as "no external requests" becomes easy to verify. For background on how browsers restrict remote resources, see MDN's overview of Content Security Policy.
You do not control third-party hosting
If your playable pulls a font or library from someone else's server, the network is trusting a host it does not manage. If that host changes, goes down or is blocked in a region, the ad degrades. Inline code removes that risk. We cover the same reasoning for Google's ecosystem in Self Contained HTML5 Ad: No CDNs, No Web Fonts.
What has to go inside the file
Here is a practical inventory of what usually moves inline:
- JavaScript: your game logic and any engine or library code, minified.
- CSS: layout, font declarations, animations.
- Images: backgrounds, characters, UI, icons. Embed them as data URIs, or as strings your code decodes into image objects.
- Audio: music and effects, in a format the target webviews support.
- Fonts: subsetted to the glyphs you actually use, or replaced with system fonts.
- Data: level layouts, tuning values and copy as JSON in the script.
- Store link and tracking hooks: the call your network expects, with no remote requests at load time.
If your playable has a call to action that opens the store, the network will tell you which API or function to call. Many networks use the MRAID standard from IAB Tech Lab, and we explain what it means for marketers in MRAID for Playable Ads. Other networks define their own call. Do not hardcode a store URL as a plain link unless the spec says to.
The costs of inlining
Single-file builds are not free. Know the tradeoffs before you commit.
Size grows. Base64 turns binary data into text that is noticeably larger than the original. A ZIP with the same assets will be smaller. Because networks cap playable size, inlining eats into your budget. Compress images and audio before they are encoded, not after.
Parse time grows. A large file with big inline strings takes longer to parse and decode on low-end phones. The first interactive frame may arrive later than you expect.
Memory use can rise. Decoding many embedded images at once uses memory. Decode what the first screen needs first and delay the rest.
Debugging is harder. A minified file with embedded assets is unreadable. Keep a normal source project and treat the inlined file as a build artifact. Never edit it by hand.
Code that breaks when you inline
Most failures come from a short list of patterns.
- fetch or XHR for local files. Loading
level1.jsonat runtime fails when there is no file to load. Put the data in the script instead. - Scripts or fonts from a CDN. Even a harmless analytics snippet or font link counts as an external request. Remove it or replace it with an inline version.
- Web Workers from separate files. A worker normally starts from its own script file. In a single file, you have to build it from an embedded string, or avoid workers altogether.
- Audio and video loaded by path. A source attribute pointing at
sound/hit.mp3has nothing to find. Decode embedded audio from a string instead. - Engine asset loaders. Many game engines assume a folder of assets. Check whether your engine has a bundled or single-file export mode, and use it.
- Hardcoded store links. A plain anchor to a store page may be blocked or ignored. Use the call the network specifies.
A build approach that holds up
Keep the playable as a normal project with separate source files. Add a build step that does the following, in order:
- Compress and resize images and audio to what the ad actually needs.
- Subset or drop fonts.
- Minify the JavaScript and CSS.
- Convert assets to embedded strings and write them into the script.
- Write everything into one HTML document.
- Run a check that fails the build if the output contains any reference to an outside address, other than the store call the network requires.
Step 6 is the one people skip, and it is the one that saves a rejected upload. A simple text search for external addresses in the built file catches most mistakes.
If you would rather not maintain this pipeline, a tool can do the packaging for you. PlayableRun builds a playable from an app store listing and exports a ZIP for Google Ads. For networks that want one file, check the spec first and confirm the format you need before you export.
How to test the built file
Test the artifact, not the source project.
- Open it with your connection off. If anything fails to load, it was relying on the network.
- Check the browser's network panel. After a reload, the only request should be the file itself.
- Check the console. Blocked requests and missing resources show up there.
- Try a throttled connection and a low-end phone. Watch how long it takes to become interactive.
- Use the network's own test tool. Each network renders playables a little differently, and the checklists in AppLovin Playable Ad: The Review Checklist and Unity Ads Playable: Creative Formats and QA Checklist show what reviewers look for.
When a ZIP is still the right answer
Single file is not universally better. Some networks, including Google Ads for HTML5, expect a ZIP with an entry file and assets inside it. A ZIP keeps binary files binary, which means smaller output and easier asset swaps. If the network accepts both, a ZIP is often the leaner choice. If it accepts only one, the decision is made for you.
Because requirements differ and change, check the current spec for each network before you export. Our overview in Playable Ad Specs: What to Check Before You Export lists what to look for without freezing numbers that will go stale.
A short rule of thumb
Build one project, then produce whichever package each network asks for. Keep every asset inside the package, make no requests at load time, and verify offline. Do that and the single-file requirement becomes a packaging step rather than a rewrite.
If you want to see what finished playables look like before you build your own, browse the live demos, or create a free account and try exporting one from a store listing.
Frequently asked questions
›What is a single file HTML playable?
It is a playable ad delivered as one HTML document. The scripts, styles, images, audio, fonts and level data are all embedded in that document, so loading it triggers no further requests for assets.
›Why do some networks require everything inline instead of a ZIP?
One file is easier to upload, store, scan, deliver through an SDK and render in a webview. It also removes broken relative paths and makes a rule like no external requests easy to verify.
›Does inlining make my playable bigger?
Usually, yes. Base64 turns binary assets into text that is noticeably larger than the originals. Compress images and audio before encoding them, and check the network's current spec for its size limit.
›What code breaks when I inline everything?
Anything that fetches a local file at runtime, loads a script or font from a CDN, or starts a worker from a separate file. Replace these with embedded data and inline code.
›How do I test a single-file playable?
Open the final built file with your network connection off, then check the browser's network panel for any request other than the file itself. Then test in the network's own preview or test tool.
Sources
Turn your store listing into a playable
Paste an App Store or Google Play link and get an HTML5 playable you can test in minutes. The first one is free.
Keep reading
- Ad network specs
Playable Ad Multiple Networks: One Build, Many Exports
6 min read
- Ad network specs
TikTok Playable Ads: Short Attention, Instant Mechanic
7 min read
- Ad network specs
Unity Ads Playable: Creative Formats and QA Checklist
6 min read