Class: shaka.ui.OverflowMenu

Constructor

(export) new OverflowMenu(parentnon-null, controlsnon-null)

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

Extends

Classes

Factory

Members

(private) abrOnSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) ariaLabels_ :Map.<HTMLElement, string>

Type:
  • Map.<HTMLElement, string>
Source:

(private) audioLangMenu_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromCaptionsButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromCaptionsSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromLanguageButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromLanguageSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromResolutionButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) backFromResolutionSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) backToOverflowMenuButtons_ :NodeList.<!Element>

Type:
  • NodeList.<!Element>
Source:

(private) captionButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) captionIcon_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) captionsNameSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) captionsOffSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) castButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) castCurrentSelectionSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) castIcon_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) castNameSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) castProxy_ :shaka.cast.CastProxy

Type:
Source:

(protected, non-null) controls :shaka.ui.Controls

Type:
Overrides:
Source:

(private, non-null) controlsContainer_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) currentAudioLanguage_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) currentCaptions_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) currentPipState_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) currentResolution_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) elementNamesToFunctions_ :Map.<string, !function()>

Type:
  • Map.<string, !function()>
Source:

(private) languageNameSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) languagesButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) localVideo_ :HTMLMediaElement

Type:
Source:

(private, non-null) overflowMenu_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) overflowMenuButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(protected, non-null) parent :HTMLElement

Type:
  • HTMLElement
Overrides:
Source:

(private) pipButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) pipIcon_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) pipNameSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(protected) player :shaka.Player

Type:
Overrides:
Source:

(private) resolutionButton_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) resolutionMenu_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) resolutionNameSpan_ :HTMLElement

Type:
  • HTMLElement
Source:

(private, non-null) textContentToLocalize_ :Map.<HTMLElement, string>

Type:
  • Map.<HTMLElement, string>
Source:

(private) textLangMenu_ :HTMLElement

Type:
  • HTMLElement
Source:

(protected) video :HTMLMediaElement

Type:
Overrides:
Source:

Methods

(private) addAudioLangMenu_()

Source:

(private) addCaptionButton_()

Source:

(private) addCastButton_()

Source:

(private) addLanguagesButton_()

Source:

(private) addOverflowMenu_()

Source:

(private) addOverflowMenuButton_()

Source:

(private) addPipButton_()

Source:

(private) addResolutionButton_()

Source:

(private) addResolutionMenu_()

Source:

(private) addTextLangMenu_()

Source:

(private) chosenIcon_() → (non-null) {Element}

Source:
Returns:
Type
Element

(private) focusOnTheChosenItem_(menu)

Parameters:
Name Type Description
menu HTMLElement
Source:

(private) getLanguageName_(locale) → {string}

Returns the language's name for itself in its own script (autoglottonym), if we have it. If the locale, including region, can be mapped to a name, we return a very specific name including the region. For example, "de-AT" would map to "Deutsch (Österreich)" or Austrian German. If only the language part of the locale is in our map, we append the locale itself for specificity. For example, "ar-EG" (Egyptian Arabic) would map to "ﺎﻠﻋﺮﺒﻳﺓ (ar-EG)". In this way, multiple versions of Arabic whose regions are not in our map would not all look the same in the language list, but could be distinguished by their locale. Finally, if language part of the locale is not in our map, we label it "unknown", as translated to the UI locale, and we append the locale itself for specificity. For example, "sjn" would map to "Unknown (sjn)". In this way, multiple unrecognized languages would not all look the same in the language list, but could be distinguished by their locale.
Parameters:
Name Type Description
locale string
Source:
Returns:
The language's name for itself in its own script, or as close as we can get with the information we have.
Type
string

(private) initOptionalElementsToNull_()

Source:

(private) isPipAllowed_() → {boolean}

Source:
Returns:
Type
boolean

(private) onAudioLanguageSelected_(language)

Parameters:
Name Type Description
language string
Source:

(private) onCaptionClick_()

Source:

(private) onCaptionStateChange_()

Source:

(async, private) onCastClick_()

Source:

(private) onCastStatusChange_(e)

Parameters:
Name Type Description
e Event
Source:

(private) onEnterPictureInPicture_()

Source:

(private) onLanguagesClick_()

Source:

(private) onLeavePictureInPicture_()

Source:

(private) onOverflowMenuButtonClick_()

Source:

(async, private) onPipClick_() → (non-null) {Promise}

Source:
Returns:
Type
Promise

(private) onResolutionClick_()

Source:

(async, private) onTextLanguageSelected_(language) → (non-null) {Promise}

Parameters:
Name Type Description
language string
Source:
Returns:
Type
Promise

(private) onTracksChange_()

Source:

(private) onTrackSelected_(tracknon-null)

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

(private) onVariantChange_()

Source:

resolveSpecialLanguageCode_(lang) → {string}

Resolve a special language code to a name/description enum.
Parameters:
Name Type Description
lang string
Source:
Returns:
Type
string

(private) setCurrentCastSelection_()

Source:

(private) updateAudioLanguages_()

Source:

(private) updateLanguages_(tracksnon-null, langMenunon-null, languagesnon-null, onLanguageSelected, updateChosen, currentSelectionElementnon-null)

Parameters:
Name Type Description
tracks Array.<shaka.extern.Track>
langMenu HTMLElement
languages Array.<string>
onLanguageSelected function(string)
updateChosen boolean
currentSelectionElement HTMLElement
Source:

(private) updateLocalizedStrings_()

Source:

(private) updateResolutionSelection_()

Source:

(private) updateTextLanguages_()

Source: