How do I add attributes to an iFrame

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • How do I add attributes to an iFrame? For example, I want to add the 'referrepolicy' attribute to C3's iFrame object so that I achieve the following:

    <iframe referrerpolicy="strict-origin-when-cross-origin">

    For context, I have a mobile App that displays YouTube videos that has worked perfectly for a number of years. I've recently been getting reports that users are seeing a YouTube '153' error and the video will not play. However, this seems to be quite random and intermittent and I've not yet seen the error on any of my test devices.

    A Google search reveals other developers having similar problems over the last 2 months and the suggested work-around is to replace 'youtube.com' with 'youtube-nocookie.com' in the URL and to add the referrerpolicy="strict-origin-when-cross-origin" attribute.

    Thanks,

    Steve.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Like most HTML objects in Construct, you can use the Set attribute action. However you'll probably need to have that set before navigating, so you'll need to do something like set the initial URL to be empty (or some placeholder), then on startup set the attribute and then navigate to the intended URL.

  • Brilliant, thanks Ashley.

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