VideoPlayer
Present videos with playback controls, captions and a preview image.
Playground and Examples use the shared browser runtime. For Service Studio inputs and event wiring, use Implementation and API.
Open OutSystems showcase ↗Connect playback to your application
The player owns playback and emits checkpoints. Your application owns media access, checkpoint storage and the aggregate viewing data. Enabling the timeline does not send analytics or create a database.
Mount the player and identify the media
Use a stable MediaId from your database; a signed media URL may change between visits. Import the theme once and this component’s CSS. Square corners are the default. ControlColor sets the play, volume, speed, captions, PiP and fullscreen controls, the timeline and the viewing curve together. Use a shared ComponentColor such as Primary, Success or Orange for appearance-aware colors, or a #RGB/#RRGGBB hex color. Custom colors choose black/white text for filled buttons; check their contrast on your toolbar in both themes. Updating ControlColor does not reload playback. The website playground and current native Blocks expose ShowPauseGlass (default true); set it to false to remove the paused glass layer while retaining the play button. Web package archives are versioned separately. AllowPictureInPicture defaults to true; the button is hidden when the browser does not expose the capability and stays disabled until media is ready. Capability detection does not guarantee that a floating window can open: browser or app restrictions, embedding permissions and direct-click requirements can still block it. The player shows a dismissible notice with the reported reason; restarting playback does not fix an unsupported or blocked browser.
import { createVideoPlayer } from '@blukavantui/community/video-player'
import type { BluVideoViewingActivity } from '@blukavantui/community/video-player'
import '@blukavantui/community/theme.css'
import '@blukavantui/community/video-player.css'
// These URLs are supplied by your application.
const status = document.getElementById('video-status')!
const player = createVideoPlayer(document.getElementById('lesson-video')!, {
MediaId: 'lesson-42',
SourceUrl: '/media/lesson-42.mp4',
PosterUrl: '/media/lesson-42.jpg',
CaptionsUrl: '/media/lesson-42.en.vtt',
CaptionLanguage: 'en',
Title: 'Getting started',
IsRounded: false,
ControlColor: 'Primary', // Theme color or #RGB / #RRGGBB.
AllowPictureInPicture: true,
ShowViewingHeatmap: false,
}, {
ViewingActivity: checkpoint => {
void saveCheckpoint(checkpoint).catch(() => {
status.textContent = 'Viewing activity could not be saved.'
// Enqueue this original checkpoint in your application-owned outbox.
})
},
Error: message => { status.textContent = message },
})
// Call player.destroy() in your router/framework cleanup hook.Provide <div id="lesson-video"></div> and <p id="video-status" role="status"></p> in the page, and obtain status before mounting. Supply caption and transcript content appropriate to your media. Cross-origin captions require matching CORS permissions on the media and VTT server. Playback starts from a user action; loading metadata allows duration and seeking controls to initialize.
Save checkpoints through your own endpoint
Create and authenticate POST /api/media/viewing-activity in your application before using this example. It is an example integration route, not a BluKavantUI service. Use your application’s normal CSRF mechanism. This callback sends the full checkpoint; the component itself performs no requests.
async function saveCheckpoint(checkpoint: BluVideoViewingActivity) {
const response = await fetch('/api/media/viewing-activity', {
method: 'POST',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrfToken, // supplied by your application
},
body: JSON.stringify(checkpoint),
keepalive: checkpoint.Reason === 'Hidden' || checkpoint.Reason === 'Destroy',
})
if (!response.ok) throw new Error('Unable to save viewing activity')
}The callback runs on Paused, Ended, Seek, Closed (Lightbox), SourceChanged, Hidden, Progress (roughly every 15 seconds while playing) and Destroy. Destroy fires synchronously before listeners and DOM are removed. Async work is not awaited during cleanup. Browser/app termination can prevent any last request; use periodic checkpoints and an application-owned retry queue if you need stronger delivery. Browser lifecycle and delivery guidance ↗
Deduplicate and aggregate on the server
- Authorize the media and derive the viewer identity from the authenticated session. Validate version, reason, finite positions, duration and segment bounds; apply payload and rate limits.
- Insert each checkpoint with a unique database constraint on
(SessionId, Sequence), scoped to your tenant or media as appropriate. Process the insert and its aggregate update in one transaction. Duplicate retries must not add views again. - For every segment, add its overlap with each time bin. Divide overlap seconds by bin width if you want a fractional view score. Sum replayed segments; do not fill gaps skipped by seeking.
- Return up to 500 ordered, non-overlapping bins with
StartSeconds,EndSecondsand nonnegativeViews. Aggregate across viewers on the server and expose no individual viewing history in the public response.
// Example aggregation step after a checkpoint has been accepted once.
// bins are application-owned records; persist updates atomically.
for (const segment of checkpoint.Segments) {
for (const bin of bins) {
const overlap = Math.max(0,
Math.min(segment.EndSeconds, bin.EndSeconds) -
Math.max(segment.StartSeconds, bin.StartSeconds))
bin.Views += overlap / (bin.EndSeconds - bin.StartSeconds)
}
}PositionSeconds is the current playhead position. Segments contains only played ranges since the previous checkpoint; pause positions alone cannot produce a viewing histogram. Values are media seconds, so 2× playback can cover two media seconds in one second of wall time. These are client observations, not proof that someone watched or completed training.
Supply the viewing curve
// Replace these sample values with your server's aggregate response.
player.update({
ShowViewingHeatmap: true,
ViewingHeatmap: [
{ StartSeconds: 0, EndSeconds: 10, Views: 12 },
{ StartSeconds: 10, EndSeconds: 20, Views: 36 },
{ StartSeconds: 20, EndSeconds: 30, Views: 18 },
],
})
// Hide it without changing playback:
// player.update({ ShowViewingHeatmap: false })The curve appears on video hover or visible keyboard focus, then hides when neither is present. It is not permanently displayed on touch devices. The scrubber meets the full-width bottom edge of the video image, directly above the button row. Taller areas represent larger supplied scores, and the largest bin is labelled “Most viewed” when seeking there. Empty data, all-zero scores or an unknown/live duration hide the curve. Updating aggregate data does not reload the video. Changing the source or MediaId emits a final checkpoint for the old media and starts a new session.
Create checkpoint, progress and aggregate storage
Create the following application-owned storage. Use MediaId plus a media revision, so replacing a video does not mix timelines from different durations. Resolve the viewer and tenant on the server.
| Entity | Fields and unique key | Purpose |
|---|---|---|
| VideoCheckpoint | TenantId, MediaId, MediaRevision, ViewerId, SessionId, Sequence, PayloadHash, ReceivedAt, PositionSeconds, SegmentsJson. Unique (TenantId, MediaId, MediaRevision, ViewerId, SessionId, Sequence). | Receipt for deduplication and optional short-lived diagnostics. |
| VideoSessionProgress | Same media/viewer/session identity, LastSequence, PositionSeconds, LastReceivedAt. | Last position per playback session; update only for a larger Sequence. |
| VideoHeatmapBin | TenantId, MediaId, MediaRevision, BinIndex, StartSeconds, EndSeconds, Views. Unique media + revision + BinIndex. | Shared aggregate using atomic increments, not last-write-wins totals. |
Validate Version, allowed Reason, bounded SessionId, positive integer Sequence, finite PositionSeconds, duration and segment bounds against trusted media metadata. Reject a reused receipt key with a different payload hash. Add request-size, segment-count and rate limits. Decide your analytics notice, retention and deletion policy before collecting viewing history.
Commit a checkpoint exactly once
SaveVideoCheckpoint — application transaction
1. Authorize the media; validate the entire checkpoint.
2. INSERT the unique VideoCheckpoint receipt.
Duplicate + same payload → return already accepted; no increments.
Duplicate + different payload → reject.
3. For each watched segment, calculate overlap with each fixed bin.
Atomic UPDATE: Views = Views + overlapSeconds / binWidthSeconds.
4. Upsert VideoSessionProgress only if Sequence > LastSequence.
5. COMMIT receipt, increments and progress together; then acknowledge.Do not use LastSequence as the deduplication rule: sequence 4 may arrive before sequence 3. Accept both unique checkpoints for the heatmap, but do not let 3 rewind the stored session position. Use a database unique constraint for the receipt and atomic increments/locking for bins; a read-modify-write loop in parallel requests can lose views. Roll back the receipt too if an aggregate update fails.
Segments contain ranges played since the last checkpoint. For a 30-second video with 10-second bins, segments [0,5] and [20,30] add [0.5, 0, 1]. The seek gap contributes nothing. Replaying those ranges in a new checkpoint adds them again; retransmitting the same checkpoint adds nothing.
Typed overlap calculation for a newly accepted checkpoint
import type { BluVideoViewingActivity, BluVideoHeatmapBin } from '@blukavantui/community/video-player'
// Pure calculation after server validation. Call ONLY for a newly inserted
// checkpoint, and commit its receipt + these increments in one DB transaction.
export function viewingIncrements(checkpoint: BluVideoViewingActivity,
duration: number, binWidth = 10): BluVideoHeatmapBin[] {
if (!Number.isFinite(duration) || duration <= 0 || !Number.isFinite(binWidth)
|| binWidth <= 0 || Math.ceil(duration / binWidth) > 500) throw new Error('Invalid bins')
const bins = Array.from({ length: Math.ceil(duration / binWidth) }, (_, i) => ({
StartSeconds: i * binWidth, EndSeconds: Math.min(duration, (i + 1) * binWidth), Views: 0,
}))
for (const segment of checkpoint.Segments) {
if (!Number.isFinite(segment.StartSeconds) || !Number.isFinite(segment.EndSeconds)
|| segment.StartSeconds < 0 || segment.EndSeconds <= segment.StartSeconds
|| segment.EndSeconds > duration) throw new Error('Invalid segment')
for (const bin of bins) {
const overlap = Math.max(0, Math.min(segment.EndSeconds, bin.EndSeconds)
- Math.max(segment.StartSeconds, bin.StartSeconds))
bin.Views += overlap / (bin.EndSeconds - bin.StartSeconds)
}
}
return bins
}
Load aggregates and recover failed delivery
Create GET /api/media/:mediaId/viewing-heatmap. Authorize access and return ordered BluVideoHeatmapBin values with StartSeconds, EndSeconds and Views. Return at most 500 non-overlapping bins, using the same stored bin boundaries as the write path. Choose bin width at media setup as at least duration / 500 (for example Max(10, Ceiling(duration / 500))).
After fetching, call player.update({ ViewingHeatmap: bins, ShowViewingHeatmap: true }). Empty data should leave the curve hidden. The timeline appears on hover or visible keyboard focus. Refresh aggregates on page load or a deliberate interval, not on every timeupdate event. Return aggregate values without individual viewing history.
On save failure, retain the original checkpoint with the same SessionId and Sequence in an application-owned outbox, retry with backoff, and remove it only after the server acknowledges it. Persisting that outbox across navigation requires application storage and a worker or other lifecycle-independent delivery mechanism. A failed promise alone does not enqueue a retry. Attach a catch handler that queues the original payload and reports failure. Progress checkpoints reduce loss, but Hidden/Destroy and keepalive delivery are best effort. Do not block navigation waiting for the last event.
Keep session progress separate from the heatmap. A position means “where this playback session stopped,” not “everything before this point was watched.” Sequences are ordered only within one SessionId. For multiple tabs, choose and document a cross-session resume policy instead of comparing their sequence numbers.
Verify before shipping
Play, pause and inspect the payload. Seek forward and confirm that the gap is absent from Segments. Play a section again, remove the component and confirm its final Destroy event. Replay the same checkpoint to your endpoint and check that totals do not change. Test a save failure and retry using the same SessionId and Sequence. Test PiP in a supporting browser: embedded browsers or page policy may reject it even when the capability exists.
Refresh the Community Content dependency
In Manage Dependencies, refresh BluKavantUi_Community_Content. Select VideoPlayer, BluVideoHeatmapBin, BluVideoViewingActivity and BluVideoWatchedSegment. Publish the consumer after refreshing. The Web TypeScript factory is not used in Service Studio.
Add screen state and the native Block
On your screen, create MediaId (Text), MediaUrl (Text), ViewingHeatmap (BluVideoHeatmapBin List), and ShowViewingHeatmap (Boolean, default False). Add a Container named VideoRegion under the screen’s content slot. Inside that Container, drag the referenced VideoPlayer Block and name its instance LessonVideo.
| LessonVideo input | Expression / value |
|---|---|
| SourceUrl | MediaUrl |
| MediaId | MediaId |
| Title | "Getting started" |
| IsRounded | False |
| ControlColor | "Primary" (or "#0f766e") |
| AllowPictureInPicture | True |
| ShowViewingHeatmap | ShowViewingHeatmap |
| ViewingHeatmap | ViewingHeatmap |
Set PosterUrl and CaptionsUrl to your resource or authorized media URLs. Populate the typed ViewingHeatmap list from a Data Action and assign ShowViewingHeatmap = True after loading it. Each row uses the exact attribute names StartSeconds, EndSeconds and Views; you do not serialize this input manually.
Handle the native event
- Create a screen Client Action named
HandleVideoActivitywith Text inputRequestedActivityJson. - On
LessonVideo → OnViewingActivity, select that handler and explicitly mapRequestedActivityJson = ActivityJson. - Inside the handler, add a JSON Deserialize node named
ReadActivity: JSON String = RequestedActivityJson; Data Type = BluVideoViewingActivity. - Pass
ReadActivity.Datato your own Server Action, for exampleSaveVideoCheckpoint. Create that action and its entities in your application; it is not supplied by the component. Use the native storage and transaction steps below: validate the checkpoint, deduplicate (SessionId, Sequence), and save played segments and aggregate updates atomically.
Wire LessonVideo.OnError.Message → HandleVideoError.RequestedMessage and display RequestedMessage in your application’s feedback region. OnPlaybackChanged.State is a simple status string; use OnViewingActivity for positions and watched ranges.
Preserve checkpoints during teardown
The Block’s OnDestroy calls the shared player cleanup, which emits the Destroy checkpoint before disposal. Keep your handler on the consuming screen. An async Server Action started during navigation is not guaranteed to finish; save Progress, Paused and Hidden checkpoints too. The native Showcase’s “Pause, close and dispose” example removes a real Block through an If widget so you can inspect the final event while its parent screen remains mounted.
Create checkpoint, progress and aggregate storage
Create the following application-owned storage. Use MediaId plus a media revision, so replacing a video does not mix timelines from different durations. Resolve the viewer and tenant on the server.
| Entity | Fields and unique key | Purpose |
|---|---|---|
| VideoCheckpoint | TenantId, MediaId, MediaRevision, ViewerId, SessionId, Sequence, PayloadHash, ReceivedAt, PositionSeconds, SegmentsJson. Unique (TenantId, MediaId, MediaRevision, ViewerId, SessionId, Sequence). | Receipt for deduplication and optional short-lived diagnostics. |
| VideoSessionProgress | Same media/viewer/session identity, LastSequence, PositionSeconds, LastReceivedAt. | Last position per playback session; update only for a larger Sequence. |
| VideoHeatmapBin | TenantId, MediaId, MediaRevision, BinIndex, StartSeconds, EndSeconds, Views. Unique media + revision + BinIndex. | Shared aggregate using atomic increments, not last-write-wins totals. |
Validate Version, allowed Reason, bounded SessionId, positive integer Sequence, finite PositionSeconds, duration and segment bounds against trusted media metadata. Reject a reused receipt key with a different payload hash. Add request-size, segment-count and rate limits. Decide your analytics notice, retention and deletion policy before collecting viewing history.
Commit a checkpoint exactly once
SaveVideoCheckpoint — application transaction
1. Authorize the media; validate the entire checkpoint.
2. INSERT the unique VideoCheckpoint receipt.
Duplicate + same payload → return already accepted; no increments.
Duplicate + different payload → reject.
3. For each watched segment, calculate overlap with each fixed bin.
Atomic UPDATE: Views = Views + overlapSeconds / binWidthSeconds.
4. Upsert VideoSessionProgress only if Sequence > LastSequence.
5. COMMIT receipt, increments and progress together; then acknowledge.Do not use LastSequence as the deduplication rule: sequence 4 may arrive before sequence 3. Accept both unique checkpoints for the heatmap, but do not let 3 rewind the stored session position. Use a database unique constraint for the receipt and atomic increments/locking for bins; a read-modify-write loop in parallel requests can lose views. Roll back the receipt too if an aggregate update fails.
Segments contain ranges played since the last checkpoint. For a 30-second video with 10-second bins, segments [0,5] and [20,30] add [0.5, 0, 1]. The seek gap contributes nothing. Replaying those ranges in a new checkpoint adds them again; retransmitting the same checkpoint adds nothing.
In Service Studio, loop through the validated BluVideoWatchedSegment List. For each bin, compute Max(0, Min(Segment.EndSeconds, Bin.EndSeconds) − Max(Segment.StartSeconds, Bin.StartSeconds)), divided by that bin’s actual width. Put the receipt and all increments in one Server Action transaction with rollback on write failures. Use a unique Entity index; an “exists” Aggregate alone is not safe against simultaneous requests.
Load aggregates and recover failed delivery
Create LoadVideoHeatmap (Data Action calling your Server Action). Authorize access and return ordered BluVideoHeatmapBin values with StartSeconds, EndSeconds and Views. Return at most 500 non-overlapping bins, using the same stored bin boundaries as the write path. Choose bin width at media setup as at least duration / 500 (for example Max(10, Ceiling(duration / 500))).
Assign the returned typed List to ViewingHeatmap and ShowViewingHeatmap = True; the bound Block inputs update without remounting. Empty data should leave the curve hidden. The timeline appears on hover or visible keyboard focus. Refresh aggregates on page load or a deliberate interval, not on every timeupdate event. Return aggregate values without individual viewing history.
On save failure, retain the original checkpoint with the same SessionId and Sequence in an application-owned outbox, retry with backoff, and remove it only after the server acknowledges it. Persisting that outbox across navigation requires application storage and a worker or other lifecycle-independent delivery mechanism. A screen Client Action can retry while mounted; if the screen disappears, keep pending work in an application-owned bridge/service rather than claiming OnDestroy guarantees completion. Progress checkpoints reduce loss, but Hidden/Destroy and keepalive delivery are best effort. Do not block navigation waiting for the last event.
Keep session progress separate from the heatmap. A position means “where this playback session stopped,” not “everything before this point was watched.” Sequences are ordered only within one SessionId. For multiple tabs, choose and document a cross-session resume policy instead of comparing their sequence numbers.
Confirm the integration
Publish, play and pause. Confirm MediaId, PositionSeconds and Segments in the event, then check your saved entity. Retry the same SessionId and Sequence and confirm only one row/aggregate update. Refresh the screen, reload the aggregate list and confirm the curve returns. Test keyboard seeking, empty data, a blocked save request and your deployment’s PiP support.
Shared component motion settings
Attach enhanceContentMotion(element, scopedController, kind) from bluui-community/src/web-motion/content.ts after creating the component. Use createComponentMotionScope to configure timing. This DOM adapter preserves the component’s controls, data and playback. Its teardown is decoration.destroy(), then scope.destroy(); the collection factory methods below do not apply to this adapter.
| Setting / method | Behavior |
|---|---|
mode | inherit (default), reduced, or off. The owning controller and operating system can always reduce or disable motion. |
duration | Optional finite-transition override, 0–2000 ms. Omit for default timings; zero is immediate. Reduced caps permitted fades at 200 ms. Continuous loading retains its own cadence. |
easing | Optional standard, ease-in, ease-out, ease-in-out, linear or spring. Omit for each component's default easing. |
ui.configure(settings?) | Replace collection defaults, update existing instances and cancel their unfinished decoration. Explicit instance overrides remain. Omit settings to restore component defaults. |
component.setMotion(settings?) | Replace just this instance's overrides. Omit settings to inherit the collection again. Inputs, focus, content and actions are retained. |
ui.destroy() | Dispose owned instances and their motion before destroying the controller. No global listener is added at import time. |
Validation rejects nonfinite, negative and over-2000-ms durations before changing settings. Motion follows the existing component behavior. Grid rows need stable keys; charts update their actual data series; workflow transitions retain their approval and save contracts. Charts respect EnableAnimation: false; continuous Sparkline glow keeps its own cadence and Pause control. Ripple, glow, shimmer and page-entry helpers remain explicit additions.
Open the playground motion controls · Read the motion and OutSystems integration guide
Current playground settings
Open the playground to load the local source example.TypeScript example
Use the source below in your application. Try the interactive component in Playground or Examples.
- JavaScript
- 8.5 KiB
- Component CSS
- 3.0 KiB
- Shared theme CSS
- 5.5 KiBonce per application
Size details
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 24.2 KiB; component CSS 12.4 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →import '@blukavantui/community/theme.css'
import { createVideoPlayer } from '@blukavantui/community/video-player'
import '@blukavantui/community/video-player.css'
export function mount(host: HTMLElement) {
const status = document.createElement('p')
status.setAttribute('role', 'status')
const player = createVideoPlayer(host, {
SourceUrl: 'https://blukavantui.blutekmedia.com/feature-previews/wing-it-review.mp4',
PosterUrl: 'https://blukavantui.blutekmedia.com/feature-previews/wing-it-review.jpg',
Title: 'Wing It! · Blender Studio · CC BY 4.0',
MediaId: 'wing-it-preview',
IsRounded: false,
ControlColor: 'Primary', // Or a custom #RGB / #RRGGBB color.
ShowPauseGlass: true, // Set false for a clear paused image.
AllowPictureInPicture: true,
ShowViewingHeatmap: true,
// Sample scores only. Fetch real aggregates from your application.
ViewingHeatmap: [{"StartSeconds":0,"EndSeconds":5,"Views":3},{"StartSeconds":5,"EndSeconds":10,"Views":8},{"StartSeconds":10,"EndSeconds":15,"Views":17},{"StartSeconds":15,"EndSeconds":20,"Views":10},{"StartSeconds":20,"EndSeconds":25,"Views":7},{"StartSeconds":25,"EndSeconds":30,"Views":5},{"StartSeconds":30,"EndSeconds":35,"Views":12},{"StartSeconds":35,"EndSeconds":40,"Views":22},{"StartSeconds":40,"EndSeconds":45,"Views":32},{"StartSeconds":45,"EndSeconds":50,"Views":15},{"StartSeconds":50,"EndSeconds":55,"Views":8},{"StartSeconds":55,"EndSeconds":60,"Views":3}],
}, {
ViewingActivity: activity => {
// This example displays the checkpoint; it does not send analytics.
// Persist on your server using SessionId + Sequence as a unique key.
status.textContent = activity.Reason + ' at ' + activity.PositionSeconds.toFixed(1) + 's'
},
Error: message => { status.textContent = message },
})
host.append(status)
return { destroy() { player.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 @blukavantui/community@1.2.1<div id="example"></div>Community components use @blukavantui/community. The ten Pro components use the separate @blukavantui/pro add-on alongside Community. Your application handles persistence and authentication through its typed callbacks. Choose the matching edition when installing the example.
Build with native Blocks
Configure the referenced Block in Service Studio using typed inputs, screen state and Client Actions. The Implementation tab includes the widget tree and exact event argument mappings.
Shared component motion settings
Attach enhanceContentMotion(element, scopedController, kind) from bluui-community/src/web-motion/content.ts after creating the component. Use createComponentMotionScope to configure timing. This DOM adapter preserves the component’s controls, data and playback. Its teardown is decoration.destroy(), then scope.destroy(); the collection factory methods below do not apply to this adapter.
| Setting / method | Behavior |
|---|---|
mode | inherit (default), reduced, or off. The owning controller and operating system can always reduce or disable motion. |
duration | Optional finite-transition override, 0–2000 ms. Omit for default timings; zero is immediate. Reduced caps permitted fades at 200 ms. Continuous loading retains its own cadence. |
easing | Optional standard, ease-in, ease-out, ease-in-out, linear or spring. Omit for each component's default easing. |
ui.configure(settings?) | Replace collection defaults, update existing instances and cancel their unfinished decoration. Explicit instance overrides remain. Omit settings to restore component defaults. |
component.setMotion(settings?) | Replace just this instance's overrides. Omit settings to inherit the collection again. Inputs, focus, content and actions are retained. |
ui.destroy() | Dispose owned instances and their motion before destroying the controller. No global listener is added at import time. |
Validation rejects nonfinite, negative and over-2000-ms durations before changing settings. Motion follows the existing component behavior. Grid rows need stable keys; charts update their actual data series; workflow transitions retain their approval and save contracts. Charts respect EnableAnimation: false; continuous Sparkline glow keeps its own cadence and Pause control. Ripple, glow, shimmer and page-entry helpers remain explicit additions.
Open the playground motion controls · Read the motion and OutSystems integration guide
Current playground settings
Open the playground to load the local source example.createVideoPlayer
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 { createVideoPlayer } from '@blukavantui/community/video-player';
import '@blukavantui/community/video-player.css';Load @blukavantui/community/theme.css once in your app shell.createVideoPlayer(host: HTMLElement, options: T.VideoPlayerOptions, events?: T.VideoPlayerEvents)Reference for @blukavantui/community 1.1.0. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
17| Name | Type / requirement | Usage |
|---|---|---|
ControlColor | ComponentColor | `#${string}`Optional | Shared color for video buttons, timeline and volume: ComponentColor name or #RGB/#RRGGBB. Default: Primary. |
ShowPauseGlass | booleanOptional | Show a subtle frosted overlay while paused; hidden during playback. Default: True. |
SourceUrl | stringOptional | Self-hosted video URL. Metadata is loaded for the controls; playback starts only on user action. 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. Player controls allow changing it. Default: False. |
AspectRatio | stringOptional | Positive width / height ratio of the media frame. Default: "16 / 9". |
AccessibleLabel | stringOptional | Optional accessible name; empty uses a sensible component label. Default: "". |
ExtendedClass | stringOptional | Additional classes on the component root. Default: "". |
IsRounded | booleanOptional | Use rounded corners on the video frame. Square by default. Default: False. |
MediaId | stringOptional | Stable application-owned media identifier included in viewing events. Default: "". |
ShowViewingHeatmap | booleanOptional | Show the supplied aggregate viewing curve on hover or keyboard focus. Default: False. |
ViewingHeatmap | BluVideoHeatmapBin[]Optional | Ordered non-overlapping aggregate ranges, up to 500. The host stores and calculates these. |
AllowPictureInPicture | booleanOptional | Display picture-in-picture when the browser supports it. Default: True. |
Callbacks
3| Name | Type / requirement | Usage |
|---|---|---|
ViewingActivity | (activity: T.BluVideoViewingActivity) => void | Promise<void>Optional | Synchronously invoked before cleanup on Destroy. Async persistence is not awaited; also handle Hidden/Progress. |
PlaybackChanged | (state: string) => 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.VideoPlayerOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
BluVideoHeatmapBin
One aggregated viewing range. Ranges must be ordered and not overlap.
interface BluVideoHeatmapBin {
StartSeconds: number;
EndSeconds: number;
Views: number;
}BluVideoViewingActivity
Incremental playback checkpoint. Deduplicate by SessionId + Sequence before aggregation.
interface BluVideoViewingActivity {
Version: 1;
SessionId: string;
Sequence: number;
MediaId: string;
Reason: "Paused" | "Ended" | "Seek" | "Progress" | "Hidden" | "SourceChanged" | "Closed" | "Destroy";
PositionSeconds: number;
/** Zero until a finite duration is known. */
DurationSeconds: number;
/** Played ranges since the previous checkpoint. Seeking gaps are excluded. */
Segments: BluVideoWatchedSegment[];
}BluVideoWatchedSegment
interface BluVideoWatchedSegment {
StartSeconds: number;
EndSeconds: number;
}ComponentColor
type ComponentColor = typeof componentColors[number];Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Free Community component on Web and OutSystems. Native Forge package availability is documented in the setup guide. View Community scope →
Open OutSystems showcase ↗- Web runtime
- Reviewed
- TypeScript
- Reviewed
- OutSystems
- Reviewed
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance → · Review evidence →Purpose and use
Present videos with playback controls, captions and a preview image.
Keyboard design guidance
Use the native video controls for play, pause, volume, captions and fullscreen. Supply captions and an audio description or transcript when the content requires them.
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.