Skip to content

Movie Loading Parameters

chameleonxxl edited this page May 18, 2026 · 1 revision

dirplayer-rs honours a small set of reserved external parameters that let you change the runtime environment a movie observes — without patching the movie itself. The host page passes them in the same way it passes any other external parameter (via <embed> attributes, <object> <param> tags, or data-sw-… attributes); dirplayer-rs reads them at runtime and rewrites the value that Lingo sees when it asks for the affected property.

These are useful when a movie was built for a specific deployment context (a Shockwave plugin, a host site, a Director projector) and gates behaviour on _system.environmentPropList.runMode or the moviePath / the movieName. With reserved external params you can make the movie believe it's running in its original environment so the gates open, and you don't have to touch the binary.

This page covers:

See Polyfill - Embedding for how to attach parameters to the host <embed> / <object> element. See Debug Console Commands for JS-side helpers that can set the same overrides at runtime.


_runMode

Fakes the value of runMode. Director's stock runMode property returns a string describing which Director runtime is hosting the movie:

Director Scripting Dictionary, 11.5, runMode: Returns a string indicating the mode in which the movie is playing. Possible values are:

  • Author — the movie is running inside Director (authoring tool).
  • Projector — the movie is running as a projector executable.
  • BrowserPlugin — the movie is running as a Shockwave Player plug-in (or other scripting environment like LiveConnect / ActiveX).

The safest way to test for a particular value is the contains operator, which allows partial matches.

dirplayer-rs is a browser runtime, so it returns "Plugin" by default. A movie built for a CD-ROM projector might check if _system.environmentPropList.runMode contains "Projector" before unlocking certain features (file I/O, splash screens, easter eggs); without an override that branch never runs.

Setting

<embed
  src="/movies/game.dcr"
  type="application/x-director"
  data-sw-_runMode="Projector"
/>

Or with <object>:

<object type="application/x-director">
  <param name="src" value="/movies/game.dcr" />
  <param name="_runMode" value="Projector" />
</object>

What Lingo sees

put _system.environmentPropList.runMode
-- "Projector"

put _player.runMode
-- "Projector"

if _system.environmentPropList.runMode contains "Projector" then
  -- this branch now runs
end if

Both _system.environmentPropList.runMode and _player.runMode are served from the same underlying value.

Common values

Value When to use
Plugin Default. Use for movies built for the Shockwave web plugin.
Projector Movies authored as stand-alone .exe projectors that gate features (file I/O, network, fullscreen) on this.
Author Movies that include developer-only code paths exposed only inside the Director IDE. Rare in published content.
BrowserPlugin Some older movies match the full string instead of partial — set this if contains "Plugin" matches but a full-string check fails.

Caveats

  • Only the string returned by runMode changes. dirplayer-rs is still a browser runtime; setting _runMode = "Projector" does not unlock projector-only Xtras or file-system access. Movies that try to use those after passing the gate will fail at the Xtra call site.
  • The string is returned verbatim — case-sensitive consumers (rare, but exist) need the exact spelling. Director itself returns "Author", "Projector", or "BrowserPlugin".

See also

  • Director Scripting Dictionary — runMode, environmentPropList, platform.

_moviePath

Fakes the value of the moviePath and the movieName. Director's the moviePath returns the directory portion of the URL the movie was loaded from; the movieName returns the filename portion. Scripts commonly concatenate them — the moviePath & the movieName — to reconstruct the full URL for security checks, whitelist comparisons, or to load adjacent assets relative to the movie.

Some movies hard-check this against their original host site:

if the moviePath contains "example.com" then
  -- proceed
else
  -- refuse to start
end if

When you host such a movie on your own page, the natural moviePath becomes http://localhost:3000/movies/ (or wherever you served it), the gate trips, and the movie quietly stops. _moviePath lets you present a different value to Lingo without affecting where dirplayer-rs actually fetches files from.

Setting

<embed
  src="/movies/game.dcr"
  type="application/x-director"
  data-sw-_moviePath="http://www.example.com/client/movie.dcr"
/>

What Lingo sees

Given _moviePath = "http://www.example.com/client/movie.dcr":

put the moviePath
-- "http://www.example.com/client/"

put the movieName
-- "movie.dcr"

put the moviePath & the movieName
-- "http://www.example.com/client/movie.dcr"

dirplayer-rs parses the value as a URL, splits off the filename, and returns the directory portion for moviePath and the filename portion for movieName — matching Director's own splitting behaviour.

Important: label-only, not a URL rewrite

_moviePath only changes the value that Lingo reads. It does not redirect actual network fetches. The movie file still loads from the URL passed via src=, and any loadFile(the moviePath & "asset.png") calls will go to the real base URL.

If you need to redirect fetches as well (e.g. a movie hard-codes absolute URLs that have to be intercepted), use one of:

  • __dirplayerFlashConfig.fetchRewriteRules — for HTTP request rewriting at the polyfill level.
  • The set_movie_path_override JS API — rewrites the network base URL in addition to changing what Lingo reads.

The precedence inside dirplayer-rs is:

  1. movie_path_label (set via JS API set_movie_path_label) — label only.
  2. external_params["_moviePath"] — label only. Most common.
  3. movie_path_override (set via JS API set_movie_path_override) — rewrites net_manager.override_base_path so subsequent fetches are translated back to the real base.

Caveats

  • The value is treated as a full URL when it parses as one (http://… / https://…); the filename is anything after the last /. If you pass a value without a /, the whole thing is treated as the directory and movieName is empty.
  • Only the moviePath and the movieName are affected. Lingo getters for the real loaded URL (none are exposed directly, but some Xtras may report it) keep their real values.

See also

  • Director Scripting Dictionary — the moviePath, the movieName.
  • Polyfill - Embeddingdata-sw-… / <param name="…"> syntax for passing external params.

Reading external params from Lingo

Reserved params are normal external params; they're also visible via Director's external-param API alongside game-level ones like sw1sw30:

put externalParamCount()
put externalParamName(1)
put externalParamValue("_runMode")
put externalParamValue("_moviePath")

So a script could sanity-check or override its own behaviour based on whether the host page set a particular reserved param.


See also

Clone this wiki locally