Class: shaka.ui.ResolutionSelection

Constructor

new ResolutionSelection(parentnon-null, controlsnon-null)

Parameters:
Name Type Description
parent HTMLElement
controls shaka.ui.Controls
Extends:
Source:

Extends

Classes

Factory

Members

abrOnSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

backButton :HTMLButtonElement

Type:
  • HTMLButtonElement
Overrides:
Implements:
Source:

backSpan :HTMLElement

Type:
  • HTMLElement
Overrides:
Implements:
Source:

button :HTMLButtonElement

Type:
  • HTMLButtonElement
Overrides:
Implements:
Source:

currentSelection :HTMLElement

Type:
  • HTMLElement
Overrides:
Implements:
Source:

isInMenuGroup :boolean

True when the element is a child of a shaka.ui.MenuGroup.
Type:
  • boolean
Overrides:
Implements:
Source:

isMenuOpened_ :boolean

Type:
  • boolean
Overrides:
Source:

isSubMenu :boolean

Type:
  • boolean
Overrides:
Implements:
Source:

isSubMenuOpened :boolean

Type:
  • boolean
Overrides:
Implements:
Source:
Type:
  • HTMLElement
Overrides:
Implements:
Source:
Type:
  • MutationObserver
Overrides:
Source:

mutationObserver_ :MutationObserver

Type:
  • MutationObserver
Overrides:
Source:

nameSpan :HTMLElement

Type:
  • HTMLElement
Overrides:
Implements:
Source:

parent :HTMLElement

Type:
  • HTMLElement
Overrides:
Implements:
Source:

resizeObserver_ :ResizeObserver

Type:
  • ResizeObserver
Overrides:
Source:

resizeRafId_ :number

Type:
  • number
Overrides:
Source:

videoContainer_ :HTMLElement

Type:
  • HTMLElement
Overrides:
Source:

Methods

addButton_(iconText)

Parameters:
Name Type Description
iconText shaka.extern.UIIcon | string
Overrides:
Source:

adjustMenuStyle(menuElementnon-null, buttonElementnon-null, controlsContainernon-null)

Shared positioning algorithm used by both OverflowMenu and SettingsMenu. Computes: - maxHeight so the menu does not overflow the video container vertically. - left/right offset so the menu stays within the controls bar horizontally, aligned with the button that opened it.
Parameters:
Name Type Description
menuElement HTMLElement The floating menu div to position.
buttonElement HTMLElement The button that triggered the menu.
controlsContainer HTMLElement The bottom controls bar used as the horizontal reference.
Overrides:
Source:

dispatchSubMenuEvent_(type)

Notifies the elements that share this submenu's container, so they hide or show their buttons. Other menu levels are not affected.
Parameters:
Name Type Description
type string
Overrides:
Source:

focusOnMenuOpen()

Moves the focus into the menu after it is opened.
Overrides:
Source:

getQualityLabel_(tracknon-null, tracksnon-null) → {string}

Parameters:
Name Type Description
track shaka.extern.Track
tracks Array<!shaka.extern.Track>
Source:
Returns:
Type
string

getQualityMark_(widthnullable, heightnullable, pixelAspectRatioopt, nullable) → {string}

Parameters:
Name Type Attributes Default Description
width number <nullable>
height number <nullable>
pixelAspectRatio string <optional>
<nullable>
null
Source:
Returns:
Type
string

getResolutionHeight_(widthnullable, heightnullable, pixelAspectRationullable) → {number}

Returns a nominal height for quality labels using a 16:9 reference frame. For example, a 1920x800 video keeps its 1080p label after the black bars have been cropped from a 1920x1080 frame.
Parameters:
Name Type Attributes Description
width number <nullable>
height number <nullable>
pixelAspectRatio string <nullable>
Source:
Returns:
Type
number

getResolutionLabel_(tracknon-null, tracksnon-null) → {string}

Parameters:
Name Type Description
track shaka.extern.VideoTrack
tracks Array<!shaka.extern.VideoTrack>
Source:
Returns:
Type
string

getTextFromBandwidth_(bandwidth) → {string}

Parameters:
Name Type Description
bandwidth number
Source:
Returns:
Type
string

getVideoCodecName_(codecsnullable) → {string}

Parameters:
Name Type Attributes Description
codecs string <nullable>
Source:
Returns:
Type
string

isDolbyVision_(tracknon-null) → {boolean}

Parameters:
Name Type Description
track shaka.extern.VideoTrack
Source:
Returns:
Type
boolean

isLCEVC_(tracknon-null) → {boolean}

Parameters:
Name Type Description
track shaka.extern.VideoTrack
Source:
Returns:
Type
boolean

onTrackSelected_(tracknon-null)

Parameters:
Name Type Description
track shaka.extern.Track
Source:

onVideoTrackSelected_(tracknon-null)

Parameters:
Name Type Description
track shaka.extern.VideoTrack
Source:

shouldCloseOnMenuClick(eventnon-null) → {boolean}

Whether a click inside a submenu closes it and returns to its parent. By default any click does, since it usually chooses an item.
Parameters:
Name Type Description
event Event
Overrides:
Source:
Returns:
Type
boolean

updateAudioOnlySelection_() → {number}

Source:
Returns:
Type
number

updateLabels_()

Source:

updateResolutionSelection_() → {number}

Source:
Returns:
Type
number

updateSelection_()

Source: