Widget

Widget

Widget for controls

Constructor

new Widget(container)

Source:
Parameters:
Name Type Description
container HTMLElement

A domElement where default control widget will be attached to

Methods

addControlBar()

Source:

Add control bar

addControlButton(name)

Source:

Add buttons on top of control bar

Parameters:
Name Type Description
name string

The control button name to be created

createCustomItem() → {HTMLSpanElement}

Source:

Create custom item element

Returns:
  • The dom element icon
Type
HTMLSpanElement

createDefaultMenu()

Source:

Create default menu

createFullscreenButton() → {HTMLSpanElement}

Source:

Create Fullscreen button

Fires:
Returns:
  • The dom element icon for fullscreen
Type
HTMLSpanElement

createMainMenu(menus) → {HTMLElement}

Source:

Create main menu

Parameters:
Name Type Description
menus array

Menu array list

Returns:
  • A span element
Type
HTMLElement

createMask()

Source:

Create modal mask

createMenu() → {HTMLElement}

Source:

Create general menu

Returns:
  • A span element
Type
HTMLElement

createMenuItem(title) → {HTMLElement}

Source:

Create menu item

Parameters:
Name Type Description
title string

Title to display

Returns:
  • An anchor tag element
Type
HTMLElement

createMenuItemHeader(title) → {HTMLElement}

Source:

Create menu item header

Parameters:
Name Type Description
title string

Title to display

Returns:
  • An anchor tag element
Type
HTMLElement

createSettingButton()

Source:

Create Setting button to toggle menu

createSubMenu(title, items) → {HTMLElement}

Source:

Create sub menu

Parameters:
Name Type Description
title string

Sub menu title

items array

Item array list

Returns:
  • A span element
Type
HTMLElement

createVideoControl() → {HTMLSpanElement}

Source:

Create video control container

Returns:
  • The dom element icon for video control
Type
HTMLSpanElement

createVideoControlButton() → {HTMLSpanElement}

Source:

Create video control button

Fires:
Returns:
  • The dom element icon for video control
Type
HTMLSpanElement

createVideoControlSeekbar() → {HTMLSpanElement}

Source:

Create video seekbar

Fires:
Returns:
  • The dom element icon for video seekbar
Type
HTMLSpanElement

dispose()

Source:

Dispose widgets by detaching dom elements from container

mergeStyleOptions(element, options) → {HTMLElement}

Source:

Merge item css style

Parameters:
Name Type Description
element HTMLElement

The element to be merged with style

options object

The style options

Returns:
  • The same element with merged styles
Type
HTMLElement

Events

panolens-viewer-handler

Source:
Properties:
Name Type Description
method string

'onWindowResize' function call on Viewer

Viewer handler event

Type:
  • object

panolens-viewer-handler

Source:
Properties:
Name Type Description
method string

'toggleVideoPlay' function call on Viewer

Viewer handler event

Type:
  • object

panolens-viewer-handler

Source:
Properties:
Name Type Description
method string

'setVideoCurrentTime' function call on Viewer

data number

Percentage of current video. Range from 0.0 to 1.0

Viewer handler event

Type:
  • object