Waits the whole app is in, which outlive the screen that started them: a playback start runs from a press on one screen to a player on another. The scene's AppWaitHost keeps them, and the scene shows them as its loading spinner over the active screen's own waits (screenWaits).
Each wait is a Promise, one per wait, and it ends when the promise settles:
wait = appWaits.begin(LoadingKind.PLAYBACK_START, channelName) appWaits.done(wait) ' the player holds a stream appWaits.fail(wait, "failed") ' it failed, or the viewer left
The first settle wins and the rest do nothing, so every exit path can end the wait without checking whether another already has, and code holding one wait can never end another, which is what a wait ended by name could not promise (a player being replaced by the next channel's would end the next channel's). A wait nobody ends is ended by its kind's time limit and logged as an error.
- Source
Methods
(static) begin(kind, labelopt) → {dynamic}
Opens a wait of kind, labeled label (shown above the spinner; "" for none), and returns its Promise, or invalid when there is no host to keep it.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
kind | string | |||
label | string | <optional> | "" |
- Source
- Type:
- dynamic
(static) done(appWait) → {void}
Ends appWait because what it waited for arrived. Does nothing once it has ended.
| Name | Type | Description |
|---|---|---|
appWait | dynamic |
- Source
- Type:
- void
(static) fail(appWait, reason) → {void}
Ends appWait because what it waited for will not arrive (reason, for the log). Does nothing once it has ended.
| Name | Type | Description |
|---|---|---|
appWait | dynamic | |
reason | string |
- Source
- Type:
- void
(static) hides(entries, view) → {boolean}
Whether an open wait hides view. A start that replaced another from the same screen keeps it hidden when the replaced one ends.
| Name | Type | Description |
|---|---|---|
entries | object | |
view | object |
- Source
- Type:
- boolean
(static) hidesLaunchingScreen(kind) → {boolean}
Whether a wait of kind hides the screen it was started from while it is open. A playback start does, so the viewer sees the item's backdrop and the spinner rather than the screen they pressed Play on, unless that screen is itself a player (a channel switch).
| Name | Type | Description |
|---|---|---|
kind | string |
- Source
- Type:
- boolean
(static) hiding(entries) → {object}
The keys of the open waits that hide the screen they were started from.
| Name | Type | Description |
|---|---|---|
entries | object |
- Source
- Type:
- object
(static) isOpen(appWait) → {boolean}
Whether appWait is a wait that has not ended yet.
| Name | Type | Description |
|---|---|---|
appWait | dynamic |
- Source
- Type:
- boolean
(static) isPlaybackScreen(view) → {boolean}
Whether view is a screen that plays: reaching it is where a playback start is meant to go.
| Name | Type | Description |
|---|---|---|
view | dynamic |
- Source
- Type:
- boolean
(static) leftBehind(entries, newView) → {object}
The keys of the playback starts the viewer has left, now that newView is the active screen: it is neither the screen the start was pressed on nor a player. The start has nowhere to go any more: Back during a Play all must not start playback on whatever screen the viewer went back to.
| Name | Type | Description |
|---|---|---|
entries | object | |
newView | dynamic |
- Source
- Type:
- object
(static) limitMs(kind) → {dynamic}
How long a wait of kind may stay open before its time limit ends it. 0 for a kind that is not an app wait, which the scene ends at once: an app-wait kind without a limit is a bug.
| Name | Type | Description |
|---|---|---|
kind | string |
- Source
- Type:
- dynamic
(static) msUntilNextDeadline(entries, now) → {integer}
Milliseconds from now until the next time limit, or -1 when no wait is open.
| Name | Type | Description |
|---|---|---|
entries | object | |
now | dynamic |
- Source
- Type:
- integer
(static) overdue(entries, now) → {object}
The keys of the open waits whose time limit has passed at now.
| Name | Type | Description |
|---|---|---|
entries | object | |
now | dynamic |
- Source
- Type:
- object