I'm developing a Flask application designed to manage and initiate live streams to multiple platforms. In my app I'm implementing a "live monitor" where users can paste a stream URL and then watch the live stream through an embedded video in the page.
I've successfully implemented this functionality for YouTube live streams. When a YouTube live URL is pasted, the stream loads correctly within the iframe and scales as expected to fit the designated area.
However, I'm encountering issues with TikTok live streams. When attempting to embed a TikTok live feed using their provided blockquote embed code (which subsequently renders an <iframe>
, works only for non-live video) the result is "Video unavailable". The same happens if I try to embed manually with an Iframe.
I tried the following:
<!doctype html>
<html>
<body>
Conteúdo do título <h1 id='title_id'>{{ title }}</h1>
</body>
<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@scout2015/video/6718335390845095173"
data-video-id="6718335390845095173" style="max-width: 605px;min-width: 325px;">
<section> </section>
</blockquote>
<script async src="https://www.tiktok.com/embed.js"></script>
<iframe height="300" width= "400" src="https://www.tiktok.com/player/v1/6718335390845095173?&music_info=1&description=1" allow="fullscreen" title="test"></iframe>
</html>
This works for videos, but when I try to use it for live streams (which have the format https://www.tiktok.com/@TheUSerNAmeHere/live), it doesn't work.
I tried with actual live links. Below is just an example. I tried changing to:
cite="https://www.tiktok.com/@scout2015/live" data-video-id="live"
cite="https://www.tiktok.com/@scout2015/live" data-video-id="@scout2015"
src="https://www.tiktok.com/player/v1/@scout2015/live"
Can someone help me?
I contacted TikTok's developer support and received this answer:
Unfortunately the LIVE api is not available at this time.