Class: shaka.ui.RangeElement

Constructor

new RangeElement(parentnon-null, controlsnon-null, containerClassNamesnon-null, barClassNamesnon-null, enableWheelopt)

Parameters:
Name Type Attributes Default Description
parent HTMLElement
controls shaka.ui.Controls
containerClassNames Array<string>
barClassNames Array<string>
enableWheel boolean <optional>
false
Implements:
Source:

Members

bar :HTMLInputElement

Type:
  • HTMLInputElement
Implements:
Source:

container :HTMLElement

This container is to support IE 11. See detailed notes in less/range_elements.less for a complete explanation.
Type:
  • HTMLElement
Implements:
Source:

endFakeChangeTimer_ :shaka.util.Timer

Type:
Source:

isChanging_ :boolean

Type:
  • boolean
Source:

isMouseChanging_ :boolean

Type:
  • boolean
Source:

Methods

changeTo(value)

Called to implement keyboard-based changes, where this is no clear "end". This will simulate events like onChangeStart(), onChange(), and onChangeEnd() as appropriate.
Parameters:
Name Type Description
value number
Implements:
Source:

endMouseInteraction()

Ends an in-progress mouse interaction, if there is one, as if the user had released the button with the bar where it currently is. This lets other controls, such as the keyboard ones, take over from a drag that is still in progress. The pointer stops driving the bar until the button is pressed again, and the mouseup that ends the drag is ignored.
Implements:
Source:

getMax() → {number}

Implements:
Source:
Returns:
Type
number

getMin() → {number}

Implements:
Source:
Returns:
Type
number

getValue() → {number}

Implements:
Source:
Returns:
Type
number

getValueFromPosition(clientX) → {number}

Converts an X position within the element into a range input value.
Parameters:
Name Type Description
clientX number
Source:
Returns:
Type
number

onChange()

Called when a new value is set by user interaction. To be overridden by subclasses.
Implements:
Source:

onChangeEnd()

Called when user interaction ends. To be overridden by subclasses.
Implements:
Source:

onChangeStart(fromTouchEventopt)

Called when user interaction begins. To be overridden by subclasses.
Parameters:
Name Type Attributes Default Description
fromTouchEvent boolean <optional>
false
Implements:
Source:

onWheel_(eventnon-null)

Handle mouse wheel input to control the range value.
Parameters:
Name Type Description
event WheelEvent
Source:

setBackground(background)

Parameters:
Name Type Description
background string
Implements:
Source:

setBarValueForMouse_(event)

Synchronize the mouse position with the range value.
Parameters:
Name Type Description
event Event
Source:

setBarValueForTouch_(event)

Synchronize the touch position with the range value. Comes in handy on iOS, where users have to grab the handle in order to start seeking.
Parameters:
Name Type Description
event Event
Source:

setRange(min, max)

Parameters:
Name Type Description
min number
max number
Implements:
Source:

setStep(step)

Parameters:
Name Type Description
step number | string
Implements:
Source:

setValue(value)

Parameters:
Name Type Description
value number
Implements:
Source: