JSFiddle - React, Tailwind, and code Playground

HTML

<html>

<head>
    <script src="https://unpkg.com/@api.video/player-sdk"></script>
</head>

<body>
    <iframe id="target" width="100%" height="100%"></iframe>
    <script>
        const START_TIME = 5;
        const ENDTIME = 10;

        // create the player in the #target element
        var player = new PlayerSdk("#target", {
            id: "vi5oDagRVJBSKHxSiPux5rYD",
            autoplay: true,
            muted: true,
            hideControls: true,
        });

        player.addEventListener("ready", () => {
            player.setCurrentTime(START_TIME);
        })

        setInterval(() => {
            player.getCurrentTime((time) => {
                if (time >= ENDTIME) {
                    player.setCurrentTime(START_TIME);
                }
            });
        }, 200);
    </script>
</body>

</html>