Skip to content

VideoOverlay

Used to load and display a video player over specific bounds of the map. Extends ImageOverlay.

A video overlay uses the <video> HTML element.

Usage example

js
const videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
videoBounds = [[ 32, -130], [ 13, -100]];
new VideoOverlay(videoUrl, videoBounds ).addTo(map);

Options

OptionTypeDefaultDescription
autoplayBooleantrueWhether the video starts playing automatically when loaded.
controlsBooleanfalseWhether the browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback.
loopBooleantrueWhether the video will loop back to the beginning when played.
keepAspectRatioBooleantrueWhether the video will save aspect ratio after the projection.
mutedBooleanfalseWhether the video starts on mute when loaded.
playsInlineBooleantrueMobile browsers will play the video right where it is instead of open it up in fullscreen mode.

Events

EventDataDescription
loadFired when the video has finished loading the first frame