How do I embed a youtube video properly using the iframe plugin?

0 favourites
  • 5 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • Hello!

    I'm having a hard time trying to load a youtube video through the iframe plugin. Basically I'm loading the /embed related URL but in both preview/published cases I'm just getting a black screen. Furthermore, I've tried these settings:

    - Navigate to URL > Get black screen

    - Display HTML string > Nothing happens (actually I haven't got to understand these options very well)

    - Load a web page with the embedded youtube video on it > Black screen

    - When I open the target page with the browser plugin it shows the video so It definitely has to do with the iframe plugin

    So I'm not quite sure if it's something I'm doing wrong or at least don't know whare to start. Any ideas? Pls let me know, thanks!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just tried it and it works fine. I dropped in an iframe object, set the URL to youtube.com/embed/pWiC5Ln_0yA and previewed the project - it showed the YouTube video correctly.

  • That's actually a good direction because now I know it has to be with my browser/internet connection. Thanks!

  • I think I know what's going on, it has to do with the CORS feature but I understand that there are some parameters you can add to the plugin to allow such calls. My queston is, if I create the iframe from the library, are those parameters included bu default or is it better to put the object outside the layout to allow external contents?

    This is what I get after inspecting the target frame where the youtube video should be displayed:

  • I don't know what your code is really doing, so I can't say. But the iframe object's default properties are configured to allow YouTube embeds. So you can just match what that does.

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