How do I get the current state of multiple YouTube videos played in iframe?

0 favourites
  • 1 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • I was looking over the YouTube API example that explained how to use a button to start and pause a youtube video. In addition, the script displays the current state of the video in a text object. I tried adding several youtube videos to this example, but it seems that the script only run once, so only the first video works. I know absolutely nothing about JavaScript, so I am clueless on how to make the script repeat for other videos. I am adding something like the following for the iframe url(varSource &"?enablejsapi=1"&"&autoplay="&1) I have read through the documentary and I tried implementing the following code to the example, without any success:

    runOnStartup(async runtime =>

    {

    runtime.addEventListener("tick", () => Tick(runtime));

    });

    function Tick(runtime)

    {

    // Code to run every tick.

    // Note 'runtime' is passed.

    }

    This is the original script below

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)