UNPKG

leaflet

Version:

JavaScript library for mobile-friendly interactive maps

58 lines (57 loc) • 2.75 kB
import { ImageOverlay } from './ImageOverlay.js'; import type { Defaults, LeafletEvent, VideoOverlayDefaults, VideoOverlayEventMap, VideoOverlayOptions } from '../types.js'; /** @import {Defaults, LeafletEvent, VideoOverlayDefaults, VideoOverlayEventMap, VideoOverlayOptions} from '../types.js' */ declare const defaultOptions: { /** * Whether the video starts playing automatically when loaded. On some browsers autoplay will only work with * `muted: true`. */ autoplay: boolean; /** * Whether the browser will offer controls to allow the user to control video * playback, including volume, seeking, and pause/resume playback. */ controls: boolean; /** Whether the video will loop back to the beginning when played. */ loop: boolean; /** Whether the video will save aspect ratio after the projection. */ keepAspectRatio: boolean; /** Whether the video starts on mute when loaded. */ muted: boolean; /** Mobile browsers will play the video right where it is instead of open it up in fullscreen mode. */ playsInline: boolean; }; export type VideoOverlayDefaultsValues = typeof defaultOptions; export type VideoOverlayEvents = { /** * Fired when the video has finished loading the first frame. */ load: LeafletEvent; }; /** @typedef {typeof defaultOptions} VideoOverlayDefaultsValues */ /** * @typedef {Object} VideoOverlayEvents * @property {LeafletEvent} load Fired when the video has finished loading the first frame. */ /** * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`. * * A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video) HTML element. * @constructorDescription Instantiates a video overlay given the URL of the video (or an array of URLs, or a video * element) and the geographical bounds it is tied to. * @example * ```js * const videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm', * videoBounds = [[ 32, -130], [ 13, -100]]; * new VideoOverlay(videoUrl, videoBounds ).addTo(map); * ``` * @template {VideoOverlayOptions} [O=VideoOverlayOptions] * @template {VideoOverlayEventMap} [E=VideoOverlayEventMap] * @extends {ImageOverlay<O & VideoOverlayDefaults, E, HTMLVideoElement, string | string[] | HTMLVideoElement>} */ export declare class VideoOverlay<O extends VideoOverlayOptions = VideoOverlayOptions, E extends VideoOverlayEventMap = VideoOverlayEventMap> extends ImageOverlay<O & VideoOverlayDefaults, E, HTMLVideoElement, string | string[] | HTMLVideoElement> { /** @type {Defaults<VideoOverlayOptions>} */ static defaultOptions: Defaults<VideoOverlayOptions>; _initImage(): void; } export {};