Options
All
  • Public
  • Public/Protected
  • All
Menu

Settings element.

description

This class creates a menu of options to manipulate media that cannot be placed in the main control necessarily (such as different captions associated with media, levels of speed to play media, etc.) This element is based on YouTube's Settings element.

class

Settings

implements

PlayerComponent

Hierarchy

  • Settings

Implements

Index

Constructors

constructor

Properties

Private button

button: HTMLButtonElement

Button to toggle menu's visibility.

type

HTMLButtonElement

memberof

Settings

Private clickEvent

clickEvent: function

Event that displays main menu when clicking in Settings button.

type

callback

memberof

Settings

Type declaration

    • (): void
    • Returns void

Private hideEvent

hideEvent: function

Event that hides Settings main menu when other events occur, such as play/pause media or when resizing the user's window.

type

callback

memberof

Settings

Type declaration

    • (): void
    • Returns void

Private menu

menu: HTMLElement

HTML markup to display Settings options.

type

HTMLElement

memberof

Settings

Private originalOutput

originalOutput: string

Storage of the initial state of the menu's markup.

type

string

memberof

Settings

Private player

player: Player

Instance of OpenPlayer.

type

Player

memberof

Settings

Private submenu

Collection of items associated with a specific menu item.

type

SettingsSubMenu

memberof

Settings

Methods

addItem

  • addItem(name: string, key: string, defaultValue: string, submenu?: SettingsSubItem[], className?: string): void
  • Add a new element and subelements to Setting's menu.

    The subelements will be transformed in HTML output, and this will be cached via Settings.submenu element. A global event will be associated with the newly added elements.

    memberof

    Settings

    Parameters

    • name: string

      The name of the Settings element.

    • key: string

      Identifier to generate unique Settings' items and subitems.

    • defaultValue: string

      It can represent a number or a string.

    • Optional submenu: SettingsSubItem[]

      A collection of subitems.

    • Optional className: string

      A specific class to trigger events on submenu items.

    Returns void

addSettings

create

  • create(): void

destroy

  • destroy(): void
  • Remove HTML associated to specific OpenPlayer's element.

    This method must include the removal of its previously set events.

    memberof

    PlayerComponent

    Returns void

Object literals

Private events

events: object

Events that will be triggered in Settings element:

  • global (to hide menu on resize and manipulate speed levels, and to manipulate submenu elements)
  • media (to hide menu when media is played/paused or when controls.hide is triggered)
type

EventsList

memberof

Settings

global

global: object

Type declaration

media

media: object

Type declaration

Generated using TypeDoc