ControlBar
A plugin that displays extra buttons & controls that controls View360.
class ControlBar implements View360Plugin
Implements
Properties
Default class names that ControlBar uses
Constants for position
Automatically hide control bar on video plays.
true
to enable with default values, false
to disable.
Override default class names.
Whether to play / pause video on canvas click
Show fullscreen button.
true
to enable with default values, false
to disable.
Show gyroscope control enable / disable button.
true
to enable with default values, false
to disable.
Enable keyboard controls for video.
Pressing up / down arrow will control video volume, and pressing left / right arrow will control video time.
Show camera pie view.
true
to enable with default values, false
to disable.
Show video play / pause button.
true
to enable with default values, false
to disable.
Show video progress bar.
true
to enable with default values, false
to disable.
Show background element.
Show video current / total time
true
to enable with default values, false
to disable.
Show video volume control button.
true
to enable with default values, false
to disable.
Show VR button.
true
to enable with default values, false
to disable.
Background element of the control bar
Container element of the control bar
Custom control bar items
Control bar's default items created by ControlBarOptions
Root element of the control bar
Constructor
new ControlBar(options: Partial<ControlBarOptions>): ControlBar
Parameters
Options
Properties
DEFAULT_CLASS
DEFAULT_CLASS{ CONTROLS_BG: "view360-controls-background"; CONTROLS_BOTTOM: "view360-controls-bottom"; CONTROLS_BUTTON: "view360-controls-button"; CONTROLS_FLOAT_LEFT: "view360-controls-float-left"; CONTROLS_FLOAT_RIGHT: "view360-controls-float-right"; CONTROLS_LEFT: "view360-controls-left"; CONTROLS_MAIN: "view360-controls-main"; CONTROLS_MID: "view360-controls-mid"; CONTROLS_RIGHT: "view360-controls-right"; CONTROLS_ROOT: "view360-controls"; CONTROLS_TOP: "view360-controls-top"; FIXED: "view360-controls-fixed"; FULLSCREEN_BUTTON: "view360-controls-fullscreen"; FULLSCREEN_EXIT_BUTTON: "view360-controls-fullscreen-exit"; GYRO_DISABLED: "view360-controls-gyro-disabled"; GYRO_ENABLED: "view360-controls-gyro-enabled"; HIDDEN: "view360-controls-hidden"; MUTED_BUTTON: "view360-controls-muted"; PAUSE_BUTTON: "view360-controls-pause"; PIEVIEW_ROOT: "view360-controls-pie"; PLAY_BUTTON: "view360-controls-play"; PROGRESS_ROOT: "view360-controls-progress"; RANGE_FILLER: "view360-range-filler"; RANGE_ROOT: "view360-range"; RANGE_THUMB: "view360-range-thumb"; RANGE_TRACK: "view360-range-track"; UNAVAILABLE: "view360-controls-unavailable"; UNMUTED_BUTTON: "view360-controls-unmuted"; VIDEO_TIME_DISPLAY: "view360-controls-time"; VOLUME_ROOT: "view360-controls-volume"; VR_BUTTON: "view360-controls-vr" }
Default class names that ControlBar uses
POSITION
POSITION{ MAIN_BOTTOM: "main-bottom"; MAIN_LEFT: "main-left"; MAIN_RIGHT: "main-right"; MAIN_TOP: "main-top"; TOP_LEFT: "top-left"; TOP_RIGHT: "top-right" }
Constants for position
autoHide
autoHideboolean | Partial<AutoHideOptions>
Automatically hide control bar on video plays.
true
to enable with default values, false
to disable.
className
classNameRequired<Partial>
Override default class names.
clickToPlay
clickToPlayboolean
Whether to play / pause video on canvas click
fullscreenButton
fullscreenButtonboolean | Partial<ControlBarItemOptions>
Show fullscreen button.
true
to enable with default values, false
to disable.
gyroButton
gyroButtonboolean | Partial<ControlBarItemOptions>
Show gyroscope control enable / disable button.
true
to enable with default values, false
to disable.
keyboardControls
keyboardControlsboolean
Enable keyboard controls for video.
Pressing up / down arrow will control video volume, and pressing left / right arrow will control video time.
pieView
pieViewboolean | Partial<PieViewOptions>
Show camera pie view.
true
to enable with default values, false
to disable.
playButton
playButtonboolean | Partial<ControlBarItemOptions>
Show video play / pause button.
true
to enable with default values, false
to disable.
progressBar
progressBarboolean | Partial<ControlBarItemOptions>
Show video progress bar.
true
to enable with default values, false
to disable.
showBackground
showBackgroundboolean
Show background element.
videoTime
videoTimeboolean | Partial<ControlBarItemOptions>
Show video current / total time
true
to enable with default values, false
to disable.
volumeButton
volumeButtonboolean | Partial<ControlBarItemOptions>
Show video volume control button.
true
to enable with default values, false
to disable.
vrButton
vrButtonboolean | Partial<ControlBarItemOptions>
Show VR button.
true
to enable with default values, false
to disable.
backgroundEl
backgroundElHTMLElement
Background element of the control bar
containerEl
containerElHTMLElement
Container element of the control bar
customItems
customItems
Custom control bar items
items
itemsRecord<ValueOf, ControlBarItem[]>
Control bar's default items created by ControlBarOptions
rootEl
rootElHTMLElement
Root element of the control bar
Methods
destroy
destroyvoid
destroy(viewer: View360): void
Destroy plugin and release all resources & event handlers.
Parameters
A instance of viewer to detach plugin