VideoLightbox
Open a video from a poster or compact play control; closing pauses playback and restores focus.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 5.0 KiB
- Component CSS
- 2.3 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 13.7 KiB; component CSS 8.3 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Activate the play control to open. Escape or Close pauses playback and restores focus. Captions and accessible media content remain the application’s responsibility.
import '@blukavantui/web/theme.css'
import {createVideoLightbox} from '@blukavantui/web/video-lightbox';
import '@blukavantui/web/video-lightbox.css';
export function mount(host:HTMLElement) {
const owned:{destroy():void}[]=[];
const keep=<T extends {destroy():void}>(c:T)=>{owned.push(c);return c;};
const status=document.createElement("p");status.setAttribute("role","status");
keep(createVideoLightbox(host,{
"SourceUrl": "https://blukavantui.blutekmedia.com/bluui/rich/flower.mp4",
"PosterUrl": "https://blukavantui.blutekmedia.com/bluui/rich/coast.jpg",
"CaptionsUrl": "https://blukavantui.blutekmedia.com/bluui/rich/flower.vtt",
"CaptionLanguage": "en",
"Title": "A moment in nature \u2014 silent sample video",
"AspectRatio": "16 / 9",
"PlayLabel": "Watch the film",
"ShowPoster": true
},{OpenChanged: (isOpen) => {status.textContent="OpenChanged: "+String(isOpen);},Error: (message) => {status.textContent="Error: "+String(message);}}));host.append(status);
return {destroy(){owned.reverse().forEach(c=>c.destroy());status.remove();}};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.2.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createVideoLightbox
Pass options as the second argument and callbacks in the third argument. Keep the returned instance to update options or dispose it when its view is removed.
import { createVideoLightbox } from '@blukavantui/web/video-lightbox';
import '@blukavantui/web/video-lightbox.css';Load @blukavantui/web/theme.css once in your app shell.createVideoLightbox(host: HTMLElement, options: T.VideoLightboxOptions, events?: T.VideoLightboxEvents)Reference for @blukavantui/web 0.6.2. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
13| Name | Type / requirement | Usage |
|---|---|---|
SourceUrl | stringOptional | Self-hosted video URL. Media is loaded only when playback is requested. Default: "". |
PosterUrl | stringOptional | Image shown before playback. Default: "". |
CaptionsUrl | stringOptional | WebVTT captions URL; cross-origin media requires the appropriate CORS response. Default: "". |
CaptionLanguage | stringOptional | BCP 47 language code for the captions. Default: "en". |
Title | stringOptional | Accessible player and lightbox title. Default: "Video". |
IsLooping | booleanOptional | Repeat after playback ends; no automatic playback on page load. Default: False. |
IsMuted | booleanOptional | Initial muted state. Native controls allow changing it. Default: False. |
AspectRatio | stringOptional | Positive width / height ratio of the media frame. Default: "16 / 9". |
IsOpen | booleanOptional | Controlled open state; echo OnOpenChanged.IsOpen. Default: False. |
PlayLabel | stringOptional | Visible play button label. Default: "Watch the film". |
ShowPoster | booleanOptional | Display the poster behind the play control. Default: True. |
AccessibleLabel | stringOptional | Optional accessible name; empty uses a sensible component label. Default: "". |
ExtendedClass | stringOptional | Additional classes on the component root. Default: "". |
Callbacks
2| Name | Type / requirement | Usage |
|---|---|---|
OpenChanged | (isOpen: boolean) => void | Promise<void>Optional | |
Error | (message: string) => void | Promise<void>Optional |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<T.VideoLightboxOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Part of the full commercial BluKavantUI for OutSystems edition. View OutSystems editions →
Open OutSystems showcase ↗- Web runtime
- Partially supported
- TypeScript
- Partially supported
- OutSystems
- Partially supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Open a video from a poster or compact play control; closing pauses playback and restores focus.
Keyboard design guidance
Activate the play control to open. Escape or Close pauses playback and restores focus. Captions and accessible media content remain the application’s responsibility.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.