What a quick play's queue build ended with, and what the viewer is told when it found nothing to play. QueueManager shows the message; QuickPlayTask and GetShuffleItemsTask report the status. Pure, so the rules are unit-tested without a network seam.
A read that failed says nothing about what the item holds, so it must never read as empty: "failed" asks the viewer to try again, "empty" tells them there is nothing to try, and "unsupported" tells them this can't be played that way, which no retry changes. The text names what the build was (a slideshow, a trailer, a shuffle, or anything else that plays).
Members
(static, constant) KIND_PLAY
- Default Value
- play
(static, constant) KIND_SHUFFLE
- Default Value
- shuffle
(static, constant) KIND_SLIDESHOW
- Default Value
- slideshow
(static, constant) KIND_TRAILER
- Default Value
- trailer
(static, constant) STATUS_EMPTY
- Default Value
- empty
(static, constant) STATUS_FAILED
- Default Value
- failed
(static, constant) STATUS_OK
- Default Value
- ok
(static, constant) STATUS_UNSUPPORTED
- Default Value
- unsupported
Methods
(static) kindOf(outputAction) → {string}
The kind of launch a QuickPlayTask build is, from the output action its dispatch chose ("queue", "photo" or "trailer"), so the message follows what the build turned into: Play on a photo library is a slideshow. Shuffle runs on its own Task, whose caller passes KIND_SHUFFLE itself.
| Name | Type | Description |
|---|---|---|
outputAction | dynamic | QuickPlayTask's output action |
a KIND_ constant
- Type:
- string
(static) knownStatus(status) → {string}
status when it is one of the STATUS_ constants, otherwise STATUS_FAILED.
| Name | Type | Description |
|---|---|---|
status | dynamic |
- Type:
- string
(static) messageKey(kind, status) → {string}
The translation key of the toast for kind and status, or "" when there is nothing to say (the build found items). A missing kind reads as play. A kind with no text of its own for a status uses play's ("Can't play this." for a trailer). A status that is none of these reads as failed: an answer nobody can vouch for is never told as "nothing here".
| Name | Type | Description |
|---|---|---|
kind | dynamic | a KIND_ constant |
status | dynamic | a STATUS_ constant |
- Type:
- string
(static) messageRow(failed, empty, unsupported) → {object}
| Name | Type | Description |
|---|---|---|
failed | string | |
empty | string | |
unsupported | dynamic |
- Type:
- object
(static) messageTable() → {object}
Every toast text, by kind and status. Each kind has a failed and an empty text; only the launches that can be asked for something nothing builds (play, shuffle) have their own unsupported text.
- Type:
- object
(static) statusOf(itemCount, anyReadFailed, unsupported) → {string}
How a queue build ended: items arrived; or none did because nothing here builds this launch, or because a read failed, or though every read answered. Items that arrived play even when a fallback read failed.
| Name | Type | Description |
|---|---|---|
itemCount | integer | the items the build found |
anyReadFailed | boolean | a read did not answer |
unsupported | boolean | no dispatch branch builds this action or type |
a STATUS_ constant
- Type:
- string
(static) toastType(status) → {string}
The toast's style for status: error for a read that failed (or a status nobody can vouch for, which messageKey tells as failed), info for an empty answer or a launch nothing builds.
| Name | Type | Description |
|---|---|---|
status | dynamic | a STATUS_ constant |
a displayToast type
- Type:
- string