Gated YouTube Content: Videos Not Displaying for Known Visitors

Highlighted
Level 1

Gated YouTube Content: Videos Not Displaying for Known Visitors

I need to post/track multiple videos behind a single gate (form). As others have shown, this is doable though the application of YouTube API code

To make this work right, I have to place the same code in two places: 

  1. On WordPress Landing Page that hosts the form -- Successful completion of form unhides the content including the videos
  2. On the corresponding MKTO Known Visitor page -- Returning visitors should see content (including videos) without having to complete form again

Here's the problem I've run into. When I put the Youtube API code on both the WP landing page and the MKTO Known Visitor page, the Video does not show up for returning visitors (via KV code).

 

I can only get the videos to show up for known visitors, by removing the YouTube API code from the WP landing page. But then, of course, if I do this the videos do not show up upon successful form completion.  Here are two examples showing the two variations:

I believe it is a javascript issue (probably a simple one) but I've not figured out what is causing the issue. Any pointers or viable alternative solutions would be appreciated. Thank you in advance!