Quickstart
Paste one snippet where the video should appear. That is the whole integration.
1. Paste the snippet
<div id="pb-player"></div>
<script
src="https://cdn.stream.tulip-tech.app/sdk/web/index"
data-key="YOUR_KEY"
data-media="https://example.com/your-video.mp4"
data-target="pb-player"></script>The script is the loader. It works out which player version your page should run, loads it, and puts the player in the element named by data-target. Your page never changes again: new versions reach it without an edit.
2. Point it at a video
data-media takes your video’s own address — an MP4, WebM, HLS (.m3u8) or DASH (.mpd) file — and plays it as it is. For captions, a poster or several sources, give it a playback object instead: a small JSON document, hosted at a URL or put in the attribute itself.
{
"id": "intro",
"sources": [
{
"type": "mp4",
"url": "YOUR_VIDEO_URL"
}
],
"title": "Introduction"
}Media you upload in the dashboard is organised into playlists. Name one with data-playlist instead:
<div id="pb-player"></div>
<script
src="https://cdn.stream.tulip-tech.app/sdk/web/index"
data-key="YOUR_KEY"
data-playlist="YOUR_PLAYLIST_ID"
data-target="pb-player"></script>3. Get a key
In the dashboard, open your property, then Settings → Keys.
- No key — the player still plays, unlicensed and watermarked. A missing or wrong key never breaks your page.
- Development key — free, and watermarked. Use it while you build.
- Production key — removes the watermark. Included from the Starter edition.
If you list origins under Settings → Origins, a key is licensed on those sites only. Anywhere else it plays unlicensed, as if it had no key.
Every snippet attribute
- data-key
- Your licence key. Leave it out and the player still plays, unlicensed and watermarked.
- data-media
- What to play: a video’s own address (.mp4, .m3u8, .mpd or .webm), the URL of a playback object, or the object itself as JSON. Ignored when data-playlist is set.
- data-playlist
- A playlist id from the dashboard. The player loads it from your property’s public feed.
- data-player
- A player id from the dashboard: its configuration and theme. Without one, the player uses the defaults.
- data-pin
- One exact version for this page, such as 1.4.2. See Versions.
- data-start
- Seconds into the video to start from.
- data-target
- The id of the element to put the player in. If the page has no such element, the player goes straight after the script tag.
The loader hands these to the <pb-play> element it creates. To write that element yourself, see Element; to pin a version, see Versions.
Or use an iframe
For a site where you cannot add a script, such as some CMS fields, embed a playlist in a frame. It takes the same key as a query parameter.
<div style="position:relative;overflow:hidden;padding-bottom:56.25%"><iframe src="https://stream.tulip-tech.app/embed/YOUR_PLAYLIST_ID?key=YOUR_KEY" width="100%" height="100%" frameborder="0" scrolling="auto" title="Video" style="position:absolute;top:0;left:0" allow="autoplay; encrypted-media; fullscreen; picture-in-picture" allowfullscreen></iframe></div>Try it with your own key and video in the playground.