This guide walks you through everything needed to embed a live WebRTS stream in a web page — from installing the package to watching video play in the browser. By the end you will have a working player that connects to a Ceeblue Cloud stream endpoint, buffers automatically at the live edge, and reports start and stop events to your application.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CeeblueTV/wrts-client/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites: You need a Ceeblue account and an active stream before running this guide. Sign up for a free trial at https://ceeblue.net/free-trial/ and manage your streams at https://dashboard.ceeblue.tv.
Install the library
Add The package requires Node.js ≥ 16 and npm ≥ 7. It ships as an ES module with full TypeScript definitions included.
@ceeblue/wrts-client to your project using your preferred package manager.Get a stream endpoint
You need a WRTS endpoint URL to pass to the player. This is a JSON manifest URL in the form:To obtain it from the Ceeblue Dashboard:
- Log in to https://dashboard.ceeblue.tv.
- Open your stream and navigate to the Outputs section.
- Create a WRTS output (or locate an existing one).
- Click the Viewer eye 👁 button next to the output — the WRTS endpoint URL is displayed and can be copied directly.
player.start() in the next steps.Add an HTML video element
The player renders into a standard
<video> element. Add one to your HTML and give it an id so JavaScript can find it. The autoplay and playsinline attributes are recommended for live streams.On iOS Safari,
playsinline is required for inline playback. Without it the browser will open the native full-screen player, which does not support ManagedMediaSource.Import and start the player
Import the Replace
Player class, attach it to the video element, wire up the lifecycle callbacks, and call player.start() with your endpoint URL.https://<hostname>/wrts/out+<stream-id>/index.json with the endpoint URL you copied from the Dashboard. The Player constructor accepts the video element as its first argument and an optional custom Source class as its second argument — omitting the second argument selects the default HTTPAdaptiveSource.The onStart callback fires once the player has buffered enough data and video begins playing. The onStop callback fires whenever playback ends, either normally or due to an error. If error is defined it is a typed PlayerError object whose name field describes the cause (for example 'Data timeout' or 'Start timeout').Using the browser bundle
If you are not using a bundler or module system, load the prebuilt browser bundle directly with a<script type="module"> tag. The bundle is the browser entry point declared in package.json (dist/wrts-client.bundle.js) and includes all dependencies.
wrts-client.bundle.js to match where you placed the file in your project.
TypeScript configuration
If your project uses TypeScript, align your compiler settings with the library’s ES6 target to ensure imports resolve correctly and the build succeeds."target": "ES6" matches the library’s own compilation target. Setting "moduleResolution": "Node" ensures TypeScript follows Node.js module resolution rules, which is required to locate the @ceeblue/wrts-client package and its dependencies.
If you need a UMD-compatible build (for example, for a legacy bundler or environment that does not support ES modules), the library does not ship one from npm. You can produce one by cloning the repository and running
npm run build:iife. See the Installation guide for full build instructions.Now that you have a working player, explore these guides to go further:
- Playback controls — pause, seek, track selection, and buffer configuration
- DRM protection — configure Widevine, PlayReady, and FairPlay
- Adaptive bitrate — understand and customise the ABR and playback rate algorithms