Constructor
new AdaptationSet(root, candidatesopt, non-null, compareCodecsopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
root |
shaka.extern.Variant
|
|
|
The variant that all other variants will be tested against when being
added to the adaptation set. If a variant is not compatible with the
root, it will not be added. |
candidates |
Iterable<shaka.extern.Variant>
|
<optional>
|
|
Variants that may be compatible with the root and should be added if
compatible. If a candidate is not compatible, it will not end up in the
adaptation set. |
compareCodecs |
boolean
|
<optional>
|
true
|
|
- Source:
Members
Methods
areAdaptable(a, b, compareCodecs) → {boolean}
Parameters:
- Source:
Returns:
-
Type
-
boolean
areAudiosCompatible(a, b, compareCodecs) → {boolean}
Check if we can switch between two audio streams.
Parameters:
- Source:
Returns:
-
Type
-
boolean
areRolesEqual_(anon-null, bnon-null) → {boolean}
Check if two role lists are the equal. This will take into account all
unique behaviours when comparing roles.
Parameters:
| Name |
Type |
Description |
a |
Array<string>
|
|
b |
Array<string>
|
|
- Source:
Returns:
-
Type
-
boolean
areVideosCompatible_(a, b, compareCodecs) → {boolean}
Check if we can switch between two video streams.
Parameters:
- Source:
Returns:
-
Type
-
boolean
canTransitionBetween_(a, b) → {boolean}
Check if we can switch between two streams based on their codec and mime
type.
Parameters:
- Source:
Returns:
-
Type
-
boolean
getAudioFallbacks(variantsnon-null, candidatesnon-null, compareCodecs) → {Array<shaka.extern.Variant>}
Get the variants that adaptation can fall back to when it can't afford
any variant of |variants|, whose audio has more channels (e.g. 5.1 or
spatial audio paired only with high video qualities). The fallbacks
carry the same audio with fewer channels, one channel tier at a time
(e.g. 5.1, then stereo, then mono), and each tier only adds variants
cheaper than everything above it, so a tier is only used when the
bandwidth can't sustain the one above.
Parameters:
- Source:
Returns:
-
Type
-
Array<shaka.extern.Variant>
haveSameAudio(a, b) → {boolean}
Check if two variants carry what the user perceives as the same audio,
so that changing between them (e.g. as part of a video change) does not
change the audio track. Unlike the adaptation rules, this ignores the
codec profile within a codec family (e.g. HE-AAC and AAC-LC), which is
how HLS content usually pairs each video with its own audio group.
Parameters:
- Source:
Returns:
-
Type
-
boolean
haveSameVideoTrack(a, b) → {boolean}
Check if two variants belong to the same video track, i.e. the same
camera angle, sign language video, etc., regardless of its quality.
Parameters:
- Source:
Returns:
-
Type
-
boolean
add(variant, compareCodecs) → {boolean}
Parameters:
- Source:
Returns:
-
Type
-
boolean
canInclude(variant, compareCodecsopt) → {boolean}
Check if |variant| can be included with the set. If |canInclude| returns
|false|, calling |add| will result in it being ignored.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
variant |
shaka.extern.Variant
|
|
|
|
compareCodecs |
boolean
|
<optional>
|
true
|
|
- Source:
Returns:
-
Type
-
boolean