Series of clips in an iframe HTML

I am trying to create a series of clips in an iframe in HTML. since twitch’s API does not have its own event handler I tried to create my own using HTML but it does not seem to be working.

I attemted to use “.addEventListener(‘ended’, handler())” but once the first video ends it does not run the “myHandler()” function. But strangely it does run “myHandler()” on the first load of the page.

Is there a solution to this issue?

    <iframe id="myVideo" allowfullscreen="true" height="720"

    <script type="text/javascript">
        var videoSource = new Array();
        videoSource[0] = 'xxx';
        videoSource[1] = 'xxx';
        var i = 0;
        var videoCount = videoSource.length;

function videoPlay(videoNum) {
    document.getElementById("myVideo").setAttribute("src", `${videoSource[videoNum]}&parent=localhost&autoplay=true&muted=false`);
document.getElementById('myVideo').addEventListener('ended', myHandler);

function myHandler() {

To my knowledge there are no events omitted for “dumb iframes” and no events for clips at all, which only support dumb iframes

You will likely need a feature request

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.