The theatre
phantom.aj.moviesPlaying
The theatre: the movie player, selector and chapters.
Scripts and plugins
A script has all of it, as phantom.aj.movies, and so does a plugin, from ctx.phantom(): the SDK runs in the plugin's own frame. Each call is marked with what it needs: game:read for what the area knows and hears, which "game": "read" in the manifest grants, and game:act for doing things in it as the player, which needs "game": "act" (see Permissions).
Overview
| Member | What it does | Plugins |
|---|---|---|
open() | Opens a theatre's list, as clicking its door does (genericListVolumeClicked), and resolves with what went up once it is up: the selector for a list of films, or the lone player for a list of one. | game:act |
theatres() | The theatre lists the account knows (generic lists of kind 1037), by def id, in order. | game:read |
movies.player: The film player: phantom.aj.movies.player.
| Member | What it does | Plugins |
|---|---|---|
close() | Closes the live player as its close button does (VideoPlayerOSMF.onClose): the watching emote is cleared, the player is taken down, and whatever opened it is told. | game:act |
current() | The whole of the live player, or null when no film is open. | game:read |
mute() | Turns the film's sound off (toggleSound, which the HUD's button runs), once it is off. | game:act |
pause() | Pauses the live film (VideoPlayerOSMF.togglePlayPause(false)), and resolves once OSMF says it is paused. | game:act |
playback() | What the live player is doing, or null when no film is open. | game:read |
resume() | Plays the live film again, as its own button does: the hand-pause is cleared first (_pausedByUser), since togglePlayPause(true) keeps a film the player paused by hand paused. | game:act |
setRepeat() | Says whether the live player starts the next film itself at the end of this one (_shouldRepeatSingleMovie), rather than closing. | game:act |
unmute() | Turns the film's sound back on, once it is on. | game:act |
onBuffering() | Hears the film stall and come back, and each piece of the file arriving (progress). | game:read |
onControl() | Hears the player's own play/pause and close buttons pressed. | game:read |
onFilm() | Hears a film start, run out, or its player go, on any of the three players. | game:read |
onPlayback() | Hears what the live player is doing change: a film opening (with its place), pausing, buffering, its sound, and null when it closes. | game:read |
onState() | Hears what OSMF tells the player: it can play, playing or paused, its size, a late start. | game:read |
onSubtitle() | Hears a caption go up (its text, as the HTML the client writes) or be wiped (null). | game:read |
onTrouble() | Hears OSMF fail to load the film, or the captioning plugin. | game:read |
movies.selector: The theatre's film selector: phantom.aj.movies.selector.
| Member | What it does | Plugins |
|---|---|---|
close() | Takes the selector down, as leaving the room does (GenericListGuiManager.onRoomExit), with the player it holds. | game:act |
current() | The selector, or null when no theatre's list is open. | game:read |
dressingFor() | How the client would dress a theatre for a list's message (frameIdForMsg, videoPlayerFrameIdForMsg): the host it is drawn as, autoplay, the ask tab, and the % form's repeat and size. | game:read |
hide() | Puts the selector behind its player, as playing a film on the theatre screen does. | game:act |
play() | Plays one of the list's films, as pressing its tile does (MovieManager.onPlay), and resolves once the player holds it. | game:act |
playRandom() | Plays one of the list's films at random, as a door with autoplay does (MovieManager.chooseRandom), and resolves once the player holds it. | game:act |
printing() | Where the print flow a tile's beaker starts has got to, or null with none running. | game:read |
setFilmSize() | The size a tile's film opens at (setDefaultWidthHeight), 512 by 288 by default. | game:act |
setHost() | Draws the selector and its next player as another host (setSkinFrame, setVideoFrameId), and the live player too. | game:act |
setRepeat() | Says whether a film started from a tile loops (_shouldRepeat). | game:act |
setTitle() | Gives the selector a title by localisation id (setTitleTxt), translated at once on a selector that is up. | game:act |
show() | Puts the selector up again from behind its player (toggleVisibility). | game:act |
streams() | Every film of the open list, in order, in one message; none with no list open. | game:read |
turnPage() | Turns the selector's page, as its arrows do (onSideBtn), and resolves with the selector on the new page. | game:act |
onChange() | Hears the selector's life: its films arriving, built, shown, hidden, a page drawn, closed. | game:read |
onPress() | Hears the selector's buttons pressed: a tile's play (with the film's place), a page, close, ask. | game:read |
onPrint() | Hears the print flow a tile's beaker starts, step by step. | game:read |
movies.chapters: The branching movies and the expeditions made of them: phantom.aj.movies.chapters.
| Member | What it does | Plugins |
|---|---|---|
all() | The nodes the chapter screen lists (getAllChapters): the tree's chapters. | game:read |
answerGift() | Answers the gift popup a chapter puts up, as its buttons do: keep asks Animal Jam for the den item (keptItem, which sends it), refuse turns it down (rejectedItem). | game:act |
choose() | Picks a chapter off the running expedition's chapter screen, as pressing its tile does (chapterSelectDown), and resolves once it plays. | game:act |
chooseBranch() | Takes one of the choices at the end of the chapter playing, as pressing its tile does (onChoiceDown): 1 to 3, in the client's order. | game:act |
current() | The expedition running now, or null when none is. | game:read |
forgetChosen() | Forgets the choices taken this sitting (resetAllChosenChapters), as the end of an expedition does. | game:act |
get() | One node of the tree, or null when the tree holds none by that id. | game:read |
isSeen() | Whether the player has watched a chapter: its bit of its stat (userVarCache.isBitSet(userVarId, bitIndex)). | game:read |
next() | The node a node's choice goes on to (MovieNode.getChoiceById), 1 to 3 in the client's order, or null where the choice leads nowhere. | game:act |
node() | One node of the def cache, or null when the server sent none by that id. | game:read |
nodes() | Every node of every branching movie the server sent, by def id; none before def pack 1053. | game:read |
path() | The nodes on the path the tree walked (getAllContinuingNodes), which the expedition plays. | game:act |
tree() | Every node of a movie's tree, with the tree's own answers and whether each was seen, building the tree first if the client has not (getAllContinuingNodes, which sends nothing). | game:act |
onChoose() | Hears a chapter chosen in an expedition: off the chapter screen, or one of a film's choices. | game:read |
onGift() | Hears a chapter end with its gift popup up, which answerGift answers. | game:read |
Methods
open
open(listId: number, options?: ActOptions) => Promise<MovieOpened>Opens a theatre's list, as clicking its door does (genericListVolumeClicked), and resolves with what went up once it is up: the selector for a list of films, or the lone player for a list of one. The client asks the server for the films first, so give a slow server a longer timeoutMs. REFUSED for a list that is not a theatre; a selector already up is answered as it is, since clicking the door again would put it away.
Parameters
| Name | Type | |
|---|---|---|
listId | number | |
options optional | ActOptions |
Returns
Promise<MovieOpened>
Types
theatres
theatres() => Promise<number[]>The theatre lists the account knows (generic lists of kind 1037), by def id, in order.
Returns
Promise<number[]>
movies.player
The film player: phantom.aj.movies.player. The client keeps one in three places, by how the film was opened (the theatre's selector, the lone window for a list of one film, an expedition's chapter), and everything here finds the live one: the first that holds a film.
const stop = phantom.aj.movies.player.onPlayback((now) => {
console.log(now ? `stream ${now.streamId}${now.buffering ? ', buffering' : ''}` : 'nothing on');
});close
close(options?: ActOptions) => Promise<void>Closes the live player as its close button does (VideoPlayerOSMF.onClose): the watching emote is cleared, the player is taken down, and whatever opened it is told. Resolves once it holds no film.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<void>
Types
current
current() => Promise<MoviePlayer | null>The whole of the live player, or null when no film is open.
Returns
Promise<MoviePlayer \| null>
Types
mute
mute(options?: ActOptions) => Promise<MoviePlayback>Turns the film's sound off (toggleSound, which the HUD's button runs), once it is off.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MoviePlayback>
Types
pause
pause(options?: ActOptions) => Promise<MoviePlayback>Pauses the live film (VideoPlayerOSMF.togglePlayPause(false)), and resolves once OSMF says it is paused. NOT_READY with no film open.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MoviePlayback>
Types
playback
playback() => Promise<MoviePlayback | null>What the live player is doing, or null when no film is open. One message.
Returns
Promise<MoviePlayback \| null>
Types
resume
resume(options?: ActOptions) => Promise<MoviePlayback>Plays the live film again, as its own button does: the hand-pause is cleared first (_pausedByUser), since togglePlayPause(true) keeps a film the player paused by hand paused. Resolves once it is playing or buffering.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MoviePlayback>
Types
setRepeat
setRepeat(repeat: boolean, options?: ActOptions) => Promise<MoviePlayer>Says whether the live player starts the next film itself at the end of this one (_shouldRepeatSingleMovie), rather than closing. Resolves with what the player now holds.
Parameters
| Name | Type | |
|---|---|---|
repeat | boolean | |
options optional | ActOptions |
Returns
Promise<MoviePlayer>
Types
unmute
unmute(options?: ActOptions) => Promise<MoviePlayback>Turns the film's sound back on, once it is on.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MoviePlayback>
Types
onBuffering
onBuffering(listener: (buffering: MovieBuffering) => void) => () => voidHears the film stall and come back, and each piece of the file arriving (progress).
Parameters
| Name | Type | |
|---|---|---|
listener | (buffering: MovieBuffering) => void |
Returns
() => void. Call it to stop listening.
Types
onControl
onControl(listener: (control: MovieControl) => void) => () => voidHears the player's own play/pause and close buttons pressed.
Parameters
| Name | Type | |
|---|---|---|
listener | (control: MovieControl) => void |
Returns
() => void. Call it to stop listening.
Types
onFilm
onFilm(listener: (film: MovieFilm) => void) => () => voidHears a film start, run out, or its player go, on any of the three players.
Parameters
| Name | Type | |
|---|---|---|
listener | (film: MovieFilm) => void |
Returns
() => void. Call it to stop listening.
Types
onPlayback
onPlayback(listener: (playback: MoviePlayback | null) => void, options?: { everyFrames?: number | undefined; }) => () => voidHears what the live player is doing change: a film opening (with its place), pausing, buffering, its sound, and null when it closes. Read in the game every twelfth frame by default, about twice a second, and told only on a change.
Parameters
| Name | Type | |
|---|---|---|
listener | (playback: MoviePlayback | null) => void | |
options optional | { everyFrames?: number | undefined; } |
Returns
() => void. Call it to stop listening.
Types
onState
onState(listener: (state: MovieState) => void) => () => voidHears what OSMF tells the player: it can play, playing or paused, its size, a late start.
Parameters
| Name | Type | |
|---|---|---|
listener | (state: MovieState) => void |
Returns
() => void. Call it to stop listening.
Types
onSubtitle
onSubtitle(listener: (caption: { text: string | null; streamId: number | null; }) => void) => () => voidHears a caption go up (its text, as the HTML the client writes) or be wiped (null). Captions come only outside English, for a film with a subtitle set.
Parameters
| Name | Type | |
|---|---|---|
listener | (caption: { text: string | null; streamId: number | null; }) => void |
Returns
() => void. Call it to stop listening.
onTrouble
onTrouble(listener: (trouble: MovieTrouble) => void) => () => voidHears OSMF fail to load the film, or the captioning plugin. The client only traces these.
Parameters
| Name | Type | |
|---|---|---|
listener | (trouble: MovieTrouble) => void |
Returns
() => void. Call it to stop listening.
Types
movies.selector
The theatre's film selector: phantom.aj.movies.selector. The four tiles a theatre door opens (movie.MovieManager, left in GenericListGuiManager.movieSelector), its pages, its host, and the player it opens a film in. movies.open puts one up.
Playing a film from it is real traffic: the popup player sends the watching emote to Animal Jam, so the room sees the player sitting watching.
close
close(options?: ActOptions) => Promise<void>Takes the selector down, as leaving the room does (GenericListGuiManager.onRoomExit), with the player it holds. NOT_READY with none open.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<void>
Types
current
current() => Promise<MovieSelector | null>The selector, or null when no theatre's list is open.
Returns
Promise<MovieSelector \| null>
Types
dressingFor
dressingFor(message: string) => Promise<MovieDressing>How the client would dress a theatre for a list's message (frameIdForMsg, videoPlayerFrameIdForMsg): the host it is drawn as, autoplay, the ask tab, and the % form's repeat and size. Asks the client for the two frames; nothing changes.
Parameters
| Name | Type | |
|---|---|---|
message | string |
Returns
Promise<MovieDressing>
Types
hide
hide(options?: ActOptions) => Promise<MovieSelector>Puts the selector behind its player, as playing a film on the theatre screen does.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
play
play(index: number, options?: ActOptions) => Promise<MoviePlayback>Plays one of the list's films, as pressing its tile does (MovieManager.onPlay), and resolves once the player holds it. On the theatre screen, or a list opened at random, the film is switched under the running player (playVideoIdx); otherwise the popup player is built on it (VideoPlayerOSMF.init) in the selector's host and size. NOT_READY with no list open.
Parameters
| Name | Type | |
|---|---|---|
index | number | |
options optional | ActOptions |
Returns
Promise<MoviePlayback>
Types
playRandom
playRandom(options?: MovieRandomOptions) => Promise<MoviePlayback>Plays one of the list's films at random, as a door with autoplay does (MovieManager.chooseRandom), and resolves once the player holds it.
Parameters
| Name | Type | |
|---|---|---|
options optional | MovieRandomOptions |
Returns
Promise<MoviePlayback>
Types
printing
printing() => Promise<MoviePrintJob | null>Where the print flow a tile's beaker starts has got to, or null with none running.
Returns
Promise<MoviePrintJob \| null>
Types
setFilmSize
setFilmSize(size: { width: number; height: number; }, options?: ActOptions) => Promise<MovieSelector>The size a tile's film opens at (setDefaultWidthHeight), 512 by 288 by default.
Parameters
| Name | Type | |
|---|---|---|
size | { width: number; height: number; } | |
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
setHost
setHost(host: number | "normal" | "bradyBarr" | "tierneyThys" | "cami" | "gabby" | "biggerFrame", options?: ActOptions) => Promise<MovieSelector>Draws the selector and its next player as another host (setSkinFrame, setVideoFrameId), and the live player too. biggerFrame changes only the player's frame: the selector has none.
Parameters
| Name | Type | |
|---|---|---|
host | number | "normal" | "bradyBarr" | "tierneyThys" | "cami" | "gabby" | "biggerFrame" | |
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
setRepeat
setRepeat(repeat: boolean, options?: ActOptions) => Promise<MovieSelector>Says whether a film started from a tile loops (_shouldRepeat). Resolves with the selector.
Parameters
| Name | Type | |
|---|---|---|
repeat | boolean | |
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
setTitle
setTitle(stringId: number, options?: ActOptions) => Promise<void>Gives the selector a title by localisation id (setTitleTxt), translated at once on a selector that is up. An id the language pack has nothing for leaves the title blank.
Parameters
| Name | Type | |
|---|---|---|
stringId | number | |
options optional | ActOptions |
Returns
Promise<void>
Types
show
show(options?: ActOptions) => Promise<MovieSelector>Puts the selector up again from behind its player (toggleVisibility).
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
streams
streams() => Promise<MovieStream[]>Every film of the open list, in order, in one message; none with no list open.
Returns
Promise<MovieStream[]>
Types
turnPage
turnPage(direction: "back" | "next", options?: ActOptions) => Promise<MovieSelector>Turns the selector's page, as its arrows do (onSideBtn), and resolves with the selector on the new page. next on the last page goes round to the first, as the client's does; back on the first, or either on a list of one page, is REFUSED, since the client does nothing.
Parameters
| Name | Type | |
|---|---|---|
direction | "back" | "next" | |
options optional | ActOptions |
Returns
Promise<MovieSelector>
Types
onChange
onChange(listener: (change: MovieSelectorChange) => void) => () => voidHears the selector's life: its films arriving, built, shown, hidden, a page drawn, closed.
Parameters
| Name | Type | |
|---|---|---|
listener | (change: MovieSelectorChange) => void |
Returns
() => void. Call it to stop listening.
Types
onPress
onPress(listener: (press: MovieSelectorPress) => void) => () => voidHears the selector's buttons pressed: a tile's play (with the film's place), a page, close, ask.
Parameters
| Name | Type | |
|---|---|---|
listener | (press: MovieSelectorPress) => void |
Returns
() => void. Call it to stop listening.
Types
onPrint
onPrint(listener: (print: MoviePrint) => void) => () => voidHears the print flow a tile's beaker starts, step by step.
Parameters
| Name | Type | |
|---|---|---|
listener | (print: MoviePrint) => void |
Returns
() => void. Call it to stop listening.
Types
movies.chapters
The branching movies and the expeditions made of them: phantom.aj.movies.chapters.
A branching movie is a tree of nodes the server sent in def pack 1053 (MovieXtCommManager.movieDefs), each a film with up to three choices at its end and sometimes a den item for reaching it. The client builds the tree the first time it is asked (getAllContinuingNodes), and an expedition (game.bradyExpeditions.BradyExpeditions) walks it: a chapter picked off its chapter screen, then a choice at the end of each film.
Every read takes { baseDefId }, the movie's first node: 1, the expedition's own, by default.
all
all(options?: MovieBookOptions) => Promise<MovieChapter[]>The nodes the chapter screen lists (getAllChapters): the tree's chapters.
Parameters
| Name | Type | |
|---|---|---|
options optional | MovieBookOptions |
Returns
Promise<MovieChapter[]>
Types
answerGift
answerGift(answer: "keep" | "refuse", options?: ActOptions) => Promise<void>Answers the gift popup a chapter puts up, as its buttons do: keep asks Animal Jam for the den item (keptItem, which sends it), refuse turns it down (rejectedItem). Resolves once the popup is gone; NOT_READY with none up.
Parameters
| Name | Type | |
|---|---|---|
answer | "keep" | "refuse" | |
options optional | ActOptions |
Returns
Promise<void>
Types
choose
choose(defId: number, options?: ActOptions) => Promise<MovieExpedition>Picks a chapter off the running expedition's chapter screen, as pressing its tile does (chapterSelectDown), and resolves once it plays. NOT_READY with no chapter screen up, REFUSED for a chapter the screen has no tile for, or greys out (not yet unlocked).
Parameters
| Name | Type | |
|---|---|---|
defId | number | |
options optional | ActOptions |
Returns
Promise<MovieExpedition>
Types
chooseBranch
chooseBranch(choice: 1 | 2 | 3, options?: ActOptions) => Promise<MovieExpedition>Takes one of the choices at the end of the chapter playing, as pressing its tile does (onChoiceDown): 1 to 3, in the client's order. Resolves once the chapter it leads to plays. NOT_READY while the choice tiles are not up.
Parameters
| Name | Type | |
|---|---|---|
choice | 1 | 2 | 3 | |
options optional | ActOptions |
Returns
Promise<MovieExpedition>
Types
current
current() => Promise<MovieExpedition | null>The expedition running now, or null when none is.
Returns
Promise<MovieExpedition \| null>
Types
forgetChosen
forgetChosen(options?: ActOptions & MovieBookOptions) => Promise<void>Forgets the choices taken this sitting (resetAllChosenChapters), as the end of an expedition does. Nothing is sent.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions & MovieBookOptions |
Returns
Promise<void>
Types
get
get(defId: number, options?: MovieBookOptions) => Promise<MovieChapter | null>One node of the tree, or null when the tree holds none by that id.
Parameters
| Name | Type | |
|---|---|---|
defId | number | |
options optional | MovieBookOptions |
Returns
Promise<MovieChapter \| null>
Types
isSeen
isSeen(chapter: Pick<MovieNode, "userVarId" | "bitIndex">) => Promise<boolean>Whether the player has watched a chapter: its bit of its stat (userVarCache.isBitSet(userVarId, bitIndex)). False for a node that marks none.
Parameters
| Name | Type | |
|---|---|---|
chapter | Pick<MovieNode, "userVarId" | "bitIndex"> |
Returns
Promise<boolean>
Types
next
next(defId: number, choice: 1 | 2 | 3, options?: MovieBookOptions) => Promise<number | null>The node a node's choice goes on to (MovieNode.getChoiceById), 1 to 3 in the client's order, or null where the choice leads nowhere.
Parameters
| Name | Type | |
|---|---|---|
defId | number | |
choice | 1 | 2 | 3 | |
options optional | MovieBookOptions |
Returns
Promise<number \| null>
Types
node
node(defId: number) => Promise<MovieNode | null>One node of the def cache, or null when the server sent none by that id.
Parameters
| Name | Type | |
|---|---|---|
defId | number |
Returns
Promise<MovieNode \| null>
Types
nodes
nodes() => Promise<MovieNode[]>Every node of every branching movie the server sent, by def id; none before def pack 1053.
Returns
Promise<MovieNode[]>
Types
path
path(options?: MovieBookOptions) => Promise<MovieChapter[]>The nodes on the path the tree walked (getAllContinuingNodes), which the expedition plays.
Parameters
| Name | Type | |
|---|---|---|
options optional | MovieBookOptions |
Returns
Promise<MovieChapter[]>
Types
tree
tree(options?: MovieBookOptions) => Promise<MovieChapter[]>Every node of a movie's tree, with the tree's own answers and whether each was seen, building the tree first if the client has not (getAllContinuingNodes, which sends nothing). Empty before def pack 1053.
Parameters
| Name | Type | |
|---|---|---|
options optional | MovieBookOptions |
Returns
Promise<MovieChapter[]>
Types
onChoose
onChoose(listener: (choice: MovieChapterChoice) => void) => () => voidHears a chapter chosen in an expedition: off the chapter screen, or one of a film's choices.
Parameters
| Name | Type | |
|---|---|---|
listener | (choice: MovieChapterChoice) => void |
Returns
() => void. Call it to stop listening.
Types
onGift
onGift(listener: (gift: MovieGift) => void) => () => voidHears a chapter end with its gift popup up, which answerGift answers.
Parameters
| Name | Type | |
|---|---|---|
listener | (gift: MovieGift) => void |
Returns
() => void. Call it to stop listening.
Types
Types
The types the calls above take and give, with every field. Import any of them in a plugin from @phantomclient/plugin/sdk, or use them as they are in a script.
ActOptions
How long something that acts may take, and what may end it first.
| Field | Type | |
|---|---|---|
timeoutMs optional | number | undefined | 10 seconds by default. |
signal optional | AbortSignal | undefined |
MovieOpened
What movies.open opened: the selector for a list of films, or the lone player for one.
type MovieOpened = { kind: 'selector'; selector: MovieSelector } | { kind: 'player'; player: MoviePlayer }MoviePlayback
What a player is doing (movie.VideoPlayerOSMF and its OSMF MediaPlayer).
| Field | Type | |
|---|---|---|
place | "window" | "selector" | "expedition" | Which of the client's three players: the selector's (the theatre screen, or the popup a tile opens), the lone window the client opens for a list of one film, or an expedition's. |
streamId | number | The stream playing (StreamDef.defId), and its place in the player's list. |
index | number | null | |
playing | boolean | |
paused | boolean | |
buffering | boolean | Waiting on the stream, with the loading spiral up. |
sound | boolean | Whether the film's sound is up. |
MoviePlayer
The whole of the live player, read once.
type MoviePlayer = MoviePlayback & {
/**
* The popup player, built from a media id (`_hasMediaId`). Opening one sends the watching emote
* to Animal Jam, so the room sees the player sitting watching.
*/
popup: boolean;
/** Whether the player's own button last paused it (`_pausedByUser`), which `resume` clears. */
pausedByHand: boolean;
/** Whether it starts the next film itself at the end of this one. */
repeating: boolean;
/** The frame the popup is drawn on, which is its host. */
skinFrame: number | null;
host: MovieHost | null;
/** The size it was opened at. */
size: { width: number; height: number } | null;
/** Whether the popup artwork has landed. */
loaded: boolean;
/** Whether the player muted the game's music while the film runs. */
mutedGameMusic: boolean;
/** Whether a subtitle track is in (only outside English, for a film with a subtitle set). */
subtitles: boolean;
/** How many films the player was handed, which it steps through. */
films: number | null;
}MovieFilm
A film starting, running out, or the player going (player.onFilm).
| Field | Type | |
|---|---|---|
kind | "started" | "closed" | "finished" | |
streamId | number | null | |
index | number | null | |
popup | boolean | The popup player, which sent the watching emote. |
repeating | boolean | null | finished only: whether the player starts the next film itself. Null for the rest. |
MovieState
What OSMF tells the player (player.onState).
| Field | Type | |
|---|---|---|
kind | "state" | "size" | "canPlay" | "playState" | "startupLate" | - canPlay: it could start, where the client's five second startup check begins. - playState: playing, paused or stopped. - state: the wider player state, buffering among them. - size: the film's own size arrived, which cancels the startup check. - startupLate: five seconds went by before the size arrived. |
state | string | null | The state named, where the event carries one: playing, buffering. |
streamId | number | null |
MovieBuffering
The film stalling or coming in (player.onBuffering).
| Field | Type | |
|---|---|---|
kind | "ready" | "buffering" | "progress" | buffering / ready: OSMF began or stopped waiting. progress: more of the file arrived. |
bytes | number | null | progress: the bytes in so far and the file's size. Null for the rest. |
total | number | null | |
streamId | number | null |
MovieTrouble
OSMF failing (player.onTrouble).
| Field | Type | |
|---|---|---|
kind | "mediaError" | "pluginFailed" | "pluginError" | The film itself, or the captioning plugin the client loads outside English. |
errorId | number | null | |
message | string | null |
MovieControl
The player's own buttons pressed (player.onControl).
| Field | Type | |
|---|---|---|
kind | "close" | "playPause" | Its play and pause button, or its close button (which also runs when a film ends unlooped). |
pausedByHand | boolean | Whether it had been paused by hand before the press. |
streamId | number | null |
MovieSelector
The selector on screen (movie.MovieManager).
| Field | Type | |
|---|---|---|
page | number | Which page of four is showing, from 1, and how many the list fills. |
pages | number | |
firstMovie | number | The index of the first of the four tiles (_pageNumber). |
movies | number | How many films the list holds. |
host | "normal" | "bradyBarr" | "tierneyThys" | "cami" | "gabby" | "biggerFrame" | null | The host the selector is drawn as, or null for a frame that is none of them. |
skinFrame | number | The frame the selector is on (_skinFrameId) and the one its next player opens on. |
videoFrame | number | |
repeat | boolean | Whether a film started from a tile loops (_shouldRepeat). |
filmSize | { width: number; height: number; } | The size a tile's film opens at (_defaultWidth, _defaultHeight). |
onTheaterScreen | boolean | Whether the player draws onto the room's theatre screen rather than into a popup. |
random | boolean | Whether the list was opened to play one of its films at random. |
showing | boolean | Whether the selector is up rather than hidden behind the player. |
MovieStream
One film of the selector's list (Enums.StreamDef).
| Field | Type | |
|---|---|---|
index | number | Its place in the list, which selector.play takes. |
streamId | number | The stream's def id, which names the streams/<id>.flv the player fetches. |
thumbnailId | number | null | The media id of the tile's picture. |
baseTitleId | number | null | The localisation id of the list's own title for it. |
titleId | number | null | The localisation id of this film's title. |
subtitleId | number | null | The subtitle set, null for a film with none. Only fetched outside English. |
isNew | boolean | Whether the tile wears a New tag. |
MoviePrintJob
Where the print flow has got to (MovieManager.onConfirmPrint onwards).
| Field | Type | |
|---|---|---|
pictures | number | How many pictures were asked for, how many arrived, and how many are still being fetched. |
arrived | number | |
fetching | number |
MovieDressing
How the client would dress a theatre for one list's message (GenericListGuiManager).
| Field | Type | |
|---|---|---|
message | string | |
selectorFrame | number | The frames the selector and the player would be drawn on, and the hosts they are. |
playerFrame | number | |
selectorHost | "normal" | "bradyBarr" | "tierneyThys" | "cami" | "gabby" | "biggerFrame" | null | |
playerHost | "normal" | "bradyBarr" | "tierneyThys" | "cami" | "gabby" | "biggerFrame" | null | |
autoplay | boolean | Whether it asks for a film to start by itself (autoplay in the message). |
asks | boolean | Whether it asks for the ask tab (bb, tt, cami, gw). |
repeat | boolean | null | What the % form says for a list of one film: tt%true%640%360. Null where it says nothing. |
width | number | null | |
height | number | null |
MovieRandomOptions
How a random film is started (MovieManager.chooseRandom).
type MovieRandomOptions = ActOptions & {
/** The frame the player opens on: the selector's own host by default. */
host?: MovieHost | number;
/** Whether the film loops. False by default, as the client's is. */
repeat?: boolean;
/** The player's size, 530 by 298 by default. */
width?: number;
height?: number;
}MovieSelectorChange
Something happening to the selector (selector.onChange).
| Field | Type | |
|---|---|---|
kind | "hidden" | "shown" | "page" | "list" | "closed" | "built" | - list: the server's films arrived for a theatre door (launchMovies). - built: a selector was made for them. - shown / hidden: it was put up or put behind its player. - page: the four tiles were drawn again. - closed: it was taken down. |
listId | number | null | list only: the generic list the films came for. |
films | number | null | How many films, and the first tile showing, where read. |
firstMovie | number | null |
MovieSelectorPress
A press on the selector (selector.onPress).
| Field | Type | |
|---|---|---|
kind | "play" | "page" | "close" | "ask" | A tile's play button, a page arrow, the close button, or an ask button (the feedback popup). |
button | string | null | The artwork's name for what was pressed: playMovBtn, arrowLBtn, askBradyBtn. |
index | number | null | play: the film's place in the whole list, from the tile and the page. |
MoviePrint
The print flow a tile's beaker starts (selector.onPrint).
| Field | Type | |
|---|---|---|
kind | "page" | "answered" | "asked" | "picture" | - asked: a beaker was pressed; the yes/no popup is up. - answered: the popup was answered, yes says which way. - picture: one of the pictures arrived. - page: the sheet was drawn for the printer. |
button | string | null | |
yes | boolean | null | |
arrived | number | null | |
pictures | number | null |
MovieNode
One node of a branching movie, as the server sent it (MovieXtCommManager.movieDefs).
| Field | Type | |
|---|---|---|
defId | number | |
titleId | number | null | Localisation ids: its title (split on |), and the title shown over the film. |
streamTitleId | number | null | |
streamId | number | null | The stream it plays, and its subtitle set (null for none). |
subtitleId | number | null | |
mediaId | number | null | Media ids of the choice tile's art, its icon and its thumbnail. |
iconMediaId | number | null | |
thumbMediaId | number | null | |
choices | number[] | The nodes it can go on to, up to three, in the client's order. Empty at the movie's end. |
denRewardId | number | null | The den item it gives, null for none. |
userVarId | number | null | The stat bit the client marks once it is watched (userVarId, bitIndex). |
bitIndex | number | null |
MovieBookOptions
Which branching movie a read or an act is about: the expedition's own (1) by default.
| Field | Type | |
|---|---|---|
baseDefId optional | number | undefined |
MovieChapter
One node of the tree the client built: a def with the tree's own answers on it.
type MovieChapter = MovieNode & {
/** Whether the client counts it a chapter, which the chapter screen lists. */
isChapter: boolean;
/** Whether it is on the path the tree walked (`isCorrectChoice`). */
continuing: boolean;
/** Whether a den item is given somewhere in it. */
hasGift: boolean;
/** Whether this choice was taken this sitting. */
chosen: boolean;
/** The node it hangs from, null for the movie's first. */
parentDefId: number | null;
/** Its place in the walk, from 1: the order the chapter screen draws tiles in. */
nodeIndex: number | null;
/** Whether the player has watched it: its stat bit is set. */
seen: boolean;
/**
* Whether the chapter screen greys it out, by the client's rule
* (`ItemWindowChapterSelect.setChildrenAndInitialConditions`): never the first node, never one
* seen, never one whose bit follows a set bit. `chapters.choose` refuses a greyed one.
*/
locked: boolean;
}MovieExpedition
The expedition running now (game.bradyExpeditions.BradyExpeditions).
| Field | Type | |
|---|---|---|
baseDefId | number | The movie it walks (_baseNodeDefId). |
defId | number | null | The chapter playing, and the one a choice came from; null before one is picked. |
fromDefId | number | null | |
choices | number[] | The nodes the chapter playing goes on to. |
choosing | boolean | Whether the choice tiles are up, which chooseBranch presses. |
chapterScreen | boolean | Whether the chapter screen is up, which choose presses. |
gift | number | null | The den item offered by the gift popup that is up, or null with none up. |
MovieChapterChoice
A chapter chosen in an expedition (chapters.onChoose).
| Field | Type | |
|---|---|---|
kind | "chapter" | "branch" | Picked off the chapter screen, or one of a film's choices. |
defId | number | |
streamId | number | null | |
fromDefId | number | null | The node it was chosen from; null for a chapter picked off the screen. |
denRewardId | number | null | |
hasGift | boolean | |
userVarId | number | null | |
bitIndex | number | null | |
choices | number | How many choices it ends in. |
isChapter | boolean |
MovieGift
A chapter's gift popup coming up (chapters.onGift).
| Field | Type | |
|---|---|---|
defId | number | null | |
denItemDefId | number | null | The den item offered. |