Uncaught ReferenceError: ytcfg is not defined (also __ytRIL is not defined)
Asked Answered
O

4

147

I have been using the YouTube IFrame Player API without problem for months and started to see this exception recently when the player loads: Uncaught ReferenceError: ytcfg is not defined Inspecting the iframe, I see a successful call to yt.setConfig, but ytcfg.set fails later. Was the API changed recently? Any player parameter could cause this problem?

<script src="//s.ytimg.com/yts/jsbin/www-embed-player-vflnzmqns/www-embed-player.js" type="text/javascript" name="www-embed-player/www-embed-player"></script>
<script src="//s.ytimg.com/yts/jsbin/player-en_US-vflr--npw/base.js" name="player/base"></script>
<script>
    yt.setConfig({
        ...
    });
    writeEmbed();
</script>
<script>
    ytcsi.info('st', 35);
    ytcfg.set({
        "TIMING_ACTION": "",
        "CSI_VIEWPORT": true,
        "TIMING_INFO": {
            "c": "WEB",
            "yt_li": 1,
            "cver": "1.20161112",
            "yt_lt": "cold"
        },
        "CSI_SERVICE_NAME": "youtube"
    });
    ;</script>

There several variations of this issue:

https://issuetracker.google.com/issues/35178202 "ytcfg is not defined" https://issuetracker.google.com/issues/35177930 "__ytRIL is not defined"

Officeholder answered 16/11, 2016 at 0:39 Comment(5)
I also just started receiving this error in my test suite, which has been passing for months.Poppas
We had the same Problem with our automated Tests tonight. I filed a Bug in the Youtube Help Forum. productforums.google.com/forum/#!topic/youtube/…Cornejo
Been getting this since yesterday.Pappy
I got this error several minutes ago too, it seems not my fault now :)Sturdy
This issue renders Google Photos unusable as well.Thermaesthesia
N
30

This is a Google bug. It also happens on Youtube's developer page. https://developers.google.com/youtube/youtube_subscribe_button

The following bugs tracks this issue.

https://code.google.com/p/gdata-issues/issues/detail?id=8569 (Still active -as of Jan 5h 2017)

Please up vote on this bug using the links below so that it gets their attention. They have been sitting on it since Sep 9, 2016!!.

Norvil answered 17/11, 2016 at 22:31 Comment(5)
That’s very helpful. Everyone affected please star the issue! For clarification, the google bug corresponding to the OP’s issue is the 2nd one (id 8745), not the first, as noted in this comment in the other bug’s comment thread: code.google.com/p/gdata-issues/issues/detail?id=8668#c62Gelatinize
294 people have already starred (id 8745) but unfortunately still there no fix for this bug. Please keep staring this bug.Norvil
Looks like the google bug id 8745 was fixed some hours agoOfficeholder
Now that code.google.com/p/gdata-issues/issues/detail?id=8745 was fixed we are back in seeing this bug again. code.google.com/p/gdata-issues/issues/detail?id=8668 Unbelievable !!Norvil
Your top hyperlink is brokenJarvey
P
47

It looks like the bug is on youtube's side. You can see the same JS error here: https://www.youtube.com/embed/U-xetxYwyak

Poppas answered 16/11, 2016 at 1:46 Comment(1)
that exact link doesnt have error at this moment. However, __ytRIL is not defined error still un-fixedPanache
N
30

This is a Google bug. It also happens on Youtube's developer page. https://developers.google.com/youtube/youtube_subscribe_button

The following bugs tracks this issue.

https://code.google.com/p/gdata-issues/issues/detail?id=8569 (Still active -as of Jan 5h 2017)

Please up vote on this bug using the links below so that it gets their attention. They have been sitting on it since Sep 9, 2016!!.

Norvil answered 17/11, 2016 at 22:31 Comment(5)
That’s very helpful. Everyone affected please star the issue! For clarification, the google bug corresponding to the OP’s issue is the 2nd one (id 8745), not the first, as noted in this comment in the other bug’s comment thread: code.google.com/p/gdata-issues/issues/detail?id=8668#c62Gelatinize
294 people have already starred (id 8745) but unfortunately still there no fix for this bug. Please keep staring this bug.Norvil
Looks like the google bug id 8745 was fixed some hours agoOfficeholder
Now that code.google.com/p/gdata-issues/issues/detail?id=8745 was fixed we are back in seeing this bug again. code.google.com/p/gdata-issues/issues/detail?id=8668 Unbelievable !!Norvil
Your top hyperlink is brokenJarvey
A
6

This started happening even on youtube.com when you click the "Share" button under any video and then the "Embed" tab to copy paste the embedding html code. Definitely their fault.

Algebra answered 16/11, 2016 at 7:18 Comment(0)
M
2

I had the same issue. Temporary fix was using objects instead of iframes. It worked for me.

Melbourne answered 17/11, 2016 at 10:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.