ReferenceMedia
tiktok-video
Video component that plays TikTok videos through the TikTok embed player
The TikTok embed player expects portrait video and won’t draw its chrome below 325×578, so the element starts at that size rather than the usual 300×150.
Import
Or load it from the CDN:
Load a source
src takes a TikTok video URL or a raw numeric video id. The @user/video/<id> URLs the app hands out, share/video/<id> links, and player/v1/<id> embed URLs all work.
Controls
TikTok always draws part of its own chrome: the center play button, author header, and social rail are always visible. controls adds the progress bar and control buttons on top of those. Without controls, the element ignores pointer events, so a player skin above it receives every click.
Deferred startup
TikTok builds its player lazily: until something starts playback, the embed has no video element, reports a duration of 0, and silently drops commands. The element works around this by starting a muted autoplay and pausing it immediately, so the embed answers play, pause, and seek before the first play.
preload doesn’t change this, not even preload="none": without the warm-up, only a click inside the embed could start it, and a poster or player skin drawn over the embed takes that click. controls opts out by handing playback to TikTok’s own chrome.
Behavior
- Mute works, but there’s no volume control: the embed reports a level but takes no command to set one.
- No playback rate and no text tracks; captions are toggled with
engine.tiktok.closed_caption. posterandplaysInlinenever reach the embed: it always plays inline and draws the video’s own cover image.- Changing
controlsorloopafter the embed is up rebuilds it; rewriting the iframe URL is the only reload TikTok allows.
Examples
Basic Usage
API Reference
Attributes
These attributes configure the embedded media adapter:
Properties
Engine options
source.engine.tiktok
Pass TikTok player parameters under source.engine.tiktok, spelled exactly as TikTok spells them, each one 0 or 1, plus anything TikTok adds next. Media Sources covers how engine options fit into a structured source.
autoplay, controls, loop, and muted come from the props of the same name, so they have no engine.tiktok spelling.
Methods
Supports these media methods: exitFullscreenloadpauseplayrequestFullscreen
Events
Implements these standard media events through the embedded player: durationchangeemptiedendederrorloadedmetadataloadstartpauseplayplayingprogressseekedseekingtimeupdatevolumechangewaiting
Also emits these Video.js-specific events: