[SOLVED] YT is not defined - Uncaught ReferenceError: [youtube api]

Post

Posted
Rating:
#5034 (In Topic #1127)
Avatar
Standard member
ironfeather is in the usergroup ‘Well-settled’
Hello,

When logged in as admin on my site I kept getting a friendly nag error for admins about 

YT is not defined - Uncaught ReferenceError: [youtube api]

I have a youtube video embedded on my start page…. Everything worked ok but to fix the error I added:
 
<script src="https://www.youtube.com/player_api"></script>

into the HEAD template

and now no error :)

 

———–
Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:  Nandalow.com
Composr site for my freelance work: Futurecode.jp
My Compsr edits : 
http://ironfeather.com/bbs/viewtopic.php?f=12&t=2862
Twitter: https://twitter.com/futurecodejp

 
Online now: No Back to the top

Post

Posted
Rating:
#5035
Avatar
Standard member
ironfeather is in the usergroup ‘Well-settled’
update:

while no error pops up, i have a new one in the browser console:

Error("The YouTube player is not attached to the DOM.")

the video still works and not sure if i should worry about this, or remove my script from the HEAD….

everything works & looks good either way

———–
Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:  Nandalow.com
Composr site for my freelance work: Futurecode.jp
My Compsr edits : 
http://ironfeather.com/bbs/viewtopic.php?f=12&t=2862
Twitter: https://twitter.com/futurecodejp

 
Online now: No Back to the top

Post

Posted
Rating:
#5036
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Assuming the embed is a Composr YouTube media embed, that's strange. The JS code relating to the YouTube player is only called once the YT player's JavaScript is loaded. Maybe there's some weird fringe situation like it loading across different frames or deloading when initialised in a tooltip - as I doubt the YouTube video from your home page would show on the dashboard except in some kind of content preview fashion.

Here's a speculative fix:
https://github.com/ocproducts/composr/commit/434999ae0608f8dfc055cf896b615b670a185d36


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.
Back to Top