Methods

(static) probedPicksNeedNewAnswer(answerSource, audioIndex, subtitleIndex, sentSubtitleIndex) → {boolean}

True when picks made from the probed streams differ from what a transcode answer was built with, so that answer has to be asked for again. A direct play answer never does: the device plays the source itself and switches tracks on its own.

Parameters:
NameTypeDescription
answerSourcedynamic

the MediaSourceInfo the PlaybackInfo answer returned

audioIndexinteger

the audio index picked from the probed streams

subtitleIndexinteger

the subtitle index picked from the probed streams

sentSubtitleIndexinteger

the subtitle index the answered request carried

Returns:
Type: 
boolean

(static) serverAnswerPlays(blocker, deviceLoadsUpstream, serverAllowed) → {boolean}

True when the server's answer is the stream that plays, so the track picks it was built with matter. The device plays the source's own manifest URL when nothing blocks it and the device can load it; when it cannot but the server allowed direct play, the player's retry asks the server again with our picks (retryPlayback). Only a blocker, or a URL the device cannot load and the server refused, leaves the answer as it is.

Parameters:
NameTypeDescription
blockerstring

an UpstreamManifestBlocker value for the source

deviceLoadsUpstreamboolean

the device's check that it can load the manifest URL

serverAllowedboolean

the answer's SupportsDirectPlay

Returns:
Type: 
boolean

(static) serverAudioIndex(source) → {integer}

The audio stream index the server built its transcode for: the AudioStreamIndex in the TranscodingUrl, else the source's DefaultAudioStreamIndex, else -1.

Parameters:
NameTypeDescription
sourcedynamic

a MediaSourceInfo from a PlaybackInfo answer

Returns:
Type: 
integer

(static) sourceListsNoStreams(source) → {boolean}

True when the source exists and lists no media streams yet.

Parameters:
NameTypeDescription
sourcedynamic

a MediaSourceInfo

Returns:
Type: 
boolean