Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

HLS Video Stream

  • Widget
  • 300 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.2+

Plays an HLS (.m3u8) stream — live or recorded. The stream URL is read from a configured data key, with an optional static fallback URL.

Widget Type
  • Latest
Category
  • Video & Cameras
Use Cases
  • Drones
  • Fleet Tracking
  • Health Care
  • Industrial Automation
  • Robotics
  • Smart Building
  • Smart City
  • Smart Farming
  • Smart Home
  • Smart Office
  • Smart Retail

Who it’s for

Security managers, smart city operations centers, and remote site supervisors ask “what is the camera at this location showing right now?” They need a video feed embedded directly in ThingsBoard so operators never have to switch to a separate VMS tool.

What it does

A camera publishing to a media server at https://media.example.com/live/gate-cam/index.m3u8 plays inline inside the dashboard widget. The same widget plays a recorded VOD clip by pointing it at a recorded playlist URL. Typical glass-to-glass latency is 6–30 seconds depending on segment length and player buffer.

  • Inline HLS video player that loads any .m3u8 URL stored as a device or asset attribute
  • Live and recorded playback — the player handles both live streams and VOD playlists from the same URL field
  • Broad browser support — uses hls.js on Chrome, Firefox, and Edge; falls back to the browser’s native HLS engine on Safari
  • Fallback URL for when the attribute is empty or the device is offline
  • Shows one stream per widget; add multiple widgets to monitor several cameras simultaneously

How to set up

Data keys

KeyRoleTypeDescription
hlsStreamUrlStream URLAttributeThe .m3u8 playlist URL to play; change the key name to match your device’s attribute key

The widget ships with a function datasource key labeled hlsStreamUrl that returns a public demo playlist, so it plays a sample stream until you point the datasource at your device’s own attribute.

To point it at your own device: open the dashboard in edit mode, open the widget’s Datasources, pick the entity or entity alias, and replace the function key with the key your device reports.

If the attribute is empty and no fallback URL is configured, the player shows a blank state.

How to customize

  • To set a fallback stream — enter a Fallback stream URL in the Video streaming settings; this plays when the data key returns an empty value.
  • To control autoplay and mute — toggle Autoplay and Start muted in the Video streaming settings; browsers typically require muted start for autoplay to work.
  • To show or hide player controls — toggle Show video controls in the Video streaming settings.
  • To adjust the back-buffer length — set Back buffer length (seconds) to control how much already-played footage the player keeps in memory for rewinding.

Tips

  • HLS latency is set by the segment duration on the media server, not by the widget — if 6–30 seconds is too slow for your use case, switch to the WebRTC video stream widget which delivers sub-second latency over WHEP signaling.
  • Store the stream URL as a shared attribute on the device so it can be updated remotely (e.g. when a camera’s IP changes) without editing the dashboard.
  • For multi-camera views, place several HLS video stream widgets in a grid layout and use a single dashboard time filter to keep all feeds in sync during recorded playback.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.