Settings
ID: vSettings
| ROLE: SETTINGS
| Type: Plugin
This plugin renders and manages submenus. The root menu is a small popup on desktop, and a fullscreen modal on mobile.
info
This plugin has a Registry
containing all registered
submenus.
#
DefaultsBy default there are no submenus, but you can install an additional DefaultSettings
plugin to
get started with the Vime defaults. The default Vime settings includes submenus for setting the
playback rate, video quality and captions/subtitles.
#
Setup- Basic
- Manager
#
Usage#
Create a Submenuinfo
See SelectSubmenu
for the full API.
#
Update a Submenu#
Remove a Submenu#
Access Submenu via Event#
Access Submenu via Registry#
StoreAll properties for this plugin are backed by a store which you can access via the getStore
method.
#
PropsisMenuActive
#
Type: boolean
| Default: false
Whether the root settings menu is visible or not.
currentSubmenu
#
Type: string|null
| Default: null
The id
of the currently active submenu. If it is null
then no submenu is active.
#
MethodsgetRegistry
#
Return Type: Registry
The plugin registry where submenu instances are registered.
getStore
#
Return Type: object
See the store section above.
getEl
#
Return Type: HTMLElement
The root component HTML element.
getId
#
Return Type: string
An auto-generated id for the root menu element in the form settings-{count}
. This is to distinguish
between multiple player menus on the same page.
getControllerId
#
Return Type: string
An auto-generated id for the root menu controller in the form settings-control-{count}
.
getMenu
#
Return Type: Menu
The underlying Menu
instance.
getSubmenus
#
Return Type: Submenu[]
The rendered submenu instances.
getSubmenu
#
Parameters: (id: string)
| Return Type: Submenu|undefined
The rendered submenu instance for the given id
.
createSubmenu
#
Parameters: (id: string, type: Component = Submenu)
| Return Type: Promise<Submenu>
Creates and renders a Submenu
component and returns a Promise
that will resolve with the
rendered instance. The type
field can be used to pass in a component that extends the base Submenu
.
createSubmenus
#
Parameters: (ids: string[], type: Component = Submenu)
| Return Type: Promise<Submenu[]>
Creates and renders a list of Submenu
components and returns all their instances via a Promise
.
The type
field can be used to pass in a component that extends the base Submenu
.
removeSubmenu
#
Parameters: (id: string)
| Return Type: Promise<undefined>
Destroys a Submenu
instance matching the given id
and returns a Promise
that will resolve
once it has completed.
removeSubmenus
#
Parameters: (ids: string[])
| Return Type: Promise<undefined>
Destroys multiple Submenu
instances matching the given ids
and returns a Promise
that will
resolve once it has completed.
#
Events#
RegistryEmits Registry
events.
open
#
Data Type: undefined
Fired when the root menu becomes visible.
close
#
Data Type: undefined
Fired when the root menu becomes hidden.
opensubmenu
#
Data Type: string
Fired with the id of the submenu that's visible.
closesubmenu
#
Data Type: string
Fired with the id of the submenu that's hidden.