Installation
This plugin requires its stylesheet. Import
@photo-sphere-viewer/video-plugin/index.css or add the CDN link to your <head>.Usage
You must load one of the video adapters alongside this plugin: equirectangular video or cubemap video. Once loaded the plugin adds the following UI elements:- Play/pause button in the navbar
- Volume button in the navbar
- Time indicator in the navbar
- Progress bar above the navbar
- Large play button in the center of the viewer
Multiple resolutions
Pair the Video plugin with the Settings plugin and Resolution plugin to offer quality options:Configuration
Timed keypoints used by the autorotate button to follow the video timeline. Not updatable after init — use
setKeypoints() instead.Display a progress bar above the navbar. Not updatable after init.
Display a large play button in the center of the viewer. Not updatable after init.
Localization strings merged with the main viewer
lang object.Methods
setKeypoints(keypoints)
Replaces the current timed keypoints.
Events
play-pause
Triggered when the video starts playing or is paused.
volume-change
Triggered when the video volume changes.
progress
Triggered as the video plays.
Navbar buttons
This plugin adds the following items to the default navbar:videoPlay— play/pause the videovideoVolume— change volume or mutevideoTime— displays current time and duration (not interactive)
If you use a custom navbar, add these identifiers to your navbar configuration manually.
SCSS variables
| Variable | Default | Description |
|---|---|---|
$progressbar-height | 3px | Height of the progress bar |
$progressbar-height-active | 5px | Height of the progress bar on mouse hover |
$progressbar-progress-color | core.$buttons-color | Color of the playing progress |
$progressbar-buffer-color | core.$buttons-active-background | Color of the buffered progress |
$progressbar-handle-size | 9px | Size of the seek handle |
$progressbar-handle-color | white | Color of the seek handle |
$volume-height | 80px | Height of the volume control |
$volume-width | $progressbar-height-active | Width of the volume control |
$volume-bar-color | $progressbar-progress-color | Color of the volume bar |
$volume-track-color | $progressbar-buffer-color | Background of the volume track |
$volume-handle-size | $progressbar-handle-size | Size of the volume handle |
$volume-handle-color | $progressbar-handle-color | Color of the volume handle |
$bigbutton-color | core.$buttons-color | Color of the central play button |
$bigbutton-size | 20vw (portrait) / 10vw (landscape) | Size of the central play button |
