How to write JavaScript that could display a player with this video from a link to a video from third-party resources? Like from tik tok

For example, the following link was found in the page code

<div class="msg r" data-id="115518351">
  <p>https://www.tiktok.com/@lackyhaus/video/7010507243548429569?is_from_webapp=1&amp;sender_device=pc&amp;web_id=7228914312071792134</p>
  <div class="meta">
    <time datetime="2023-05-03">20 минут</time>          <div class="more dropdown">
        <a href="#" class="icon-ellipsis-v"></a>
        <div class="h">
          <div class="menu">
            <a href="/msg/115518351/delete">Удалить</a>
          </div>
        </div>
      </div>
      </div>
</div>

And you need to make sure that it is detected in this way

https://www.tiktok.com/(any text)/video/(any text)
