Socialtiktok.com
Can you embed TikTok in an iframe?
Yes, with the embed code or the Embed Player URL. TikTok documents both for embeds, not an iframe of the video page.
Checked Test again
Live check
Two links, two results
Video pagePartial
www.tiktok.com/@scout2015/video/6718335390845095173- X-Frame-Options
- SAMEORIGIN
- CSP frame-ancestors
- Not sent
- Response
- 200 OK · 347 ms · HTTPS
Player URLEmbeddable
www.tiktok.com/player/v1/6718335390845095173- X-Frame-Options
- Not sent
- CSP frame-ancestors
- Not sent
- Response
- 200 OK · 241 ms · HTTPS
Steps
How to embed TikTok
- Open the video page on tiktok.com in a desktop browser.
- ClickSharethenEmbed
- Copy the code from the popup.
- Paste the code into the HTML of your page.
Embed code
Paste this into your page
HTML
<iframe
src="https://www.tiktok.com/player/v1/{video-id}"
width="400"
height="700"
allow="fullscreen"
title="{video title}">
</iframe>The Embed button gives a blockquote with embed.js instead.
URL patterns
Swap the link you have for the embed URL
- You havehttps://www.tiktok.com/@{username}/video/{video-id}Use in the iframehttps://www.tiktok.com/player/v1/{video-id}
The video ID is the number at the end of the video URL.
Good to know
- Add autoplay=1, loop=1 or muted=1 to the player URL to change how the video plays.
- Add controls=0 to hide the progress bar and all control buttons.
- Add description=1 and music_info=1 to show the post text and the music.
- When a video is removed from TikTok, its embed also stops working.
Sources
- TikTok for Developers · Embed Videosdevelopers.tiktok.com/doc/embed-videos
- TikTok for Developers · Embed Playerdevelopers.tiktok.com/doc/embed-player
- MDN · X-Frame-Optionsdeveloper.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
- iframecheck live check · both links
Profile updated