versionPick

The version a viewer explicitly picked, carried to the items a queue arrives at.

A pick is made in the details screen's Video menu or by a switch in the player, and lives on the queue (QueueManager.setVersionPreference), so a new queue starts without one. An item the queue arrives at resumes nothing, so no position has a say in its version: it plays the one with the same video (resolution, codec, HDR range) when it has it, otherwise the best for the device. Matched on the stream, never the name: a name is the file's, so across items it only lines up when every item's versions share one naming scheme (jellyfin-web's rule), and it would pin a viewer to 1080p when the next item also has 4K. Only an explicit pick carries; an automatic choice stays automatic, so upgrades still happen.

Methods

(static) matchIndex(preference, mediaSources) → {integer}

matchIndex: The first source whose video matches the preference, or -1.

Parameters:
NameTypeDescription
preferencedynamic

from preferenceFor(), or invalid for "no explicit pick"

mediaSourcesdynamic

the candidate MediaSources

Returns:
Type: 
integer

(static) preferenceFor(source) → {dynamic}

preferenceFor: What an explicit version pick carries to later items — the video fields a version is told apart by, written as the version labels write them.

Parameters:
NameTypeDescription
sourcedynamic

the MediaSource the viewer picked

Returns:

{ resolution, codec, range }, or invalid when the source has no video

Type: 
dynamic

(static) sourceIndexFor(preference, mediaSources, deviceCapabilitiesopt) → {integer}

sourceIndexFor: Which version plays — the explicit pick's match, else the best for the device.

Parameters:
NameTypeAttributesDefaultDescription
preferencedynamic

from preferenceFor(), or invalid

mediaSourcesobject

the item's MediaSources

deviceCapabilitiesdynamic<optional>
invalid

for tests; invalid reads the device

Returns:
Type: 
integer