Is there a way to pull a recent youtube or vimeo video into an iframe?

0 favourites
  • 3 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • Is there a way to pull a recent youtube or vimeo video into an iframe?

    What I would like to do is have an iframe in my app that would show a current video that I post. Kind of like a news update each month or week.

    Is there a way to do this with just a video or would I have to make a webpage, put a video on that and have the iframe pull that url?

    That would be an extra step verse just posting a video and have it load into an iframe then a week later for example post another video and have it load in that one as the most recent?

    I was thinking maybe using a youtube playlist then I could just load the playlist into the iframe and then when I post a new video include it into that youtube playlist and move it to the top so it plays first.

  • I don't know if that is what you want, but there is an YT Example:

    https://editor.construct.net/#open=youtube-api

    If you click on the iFrame in the Editor you can put in an URL in the properties on the left side.

    Use https://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=YourChannelName
    
    For Example:
    https://www.youtube.com/embed?listType=user_uploads&list=ScirraVideos
    

    And that should! playing the newest Video of the Channel.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can do it using YouTube API. You need a google developers account for that, and an API key. Then you need your channel_id (which you can find by going into your Youtube channel, right click -> view source, tick "line wrap" on the top-left corner, press CTRL-F and search channel_id. The result you want should be at the bottom.

    You can request multiple videos or just one video using the "maxResults" query parameter. Ordering by date is what gives you the last video you published. Note that these fetched videos will include shorts, and as far as i know it isn't possible to filter them out easily.

    Here's the code you need

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)