8
votes

We use the YouTube embedded player on a hybrid app based on Cordova. The app has a lot of traffic worldwide.

The player displays the message "Please click here to watch this video on YouTube" to some users when they try to play any video under unclearly circumstances.

We do not see a clear pattern, it doesn't seem to depend on the user's country nor the restrictions of the video.

We have seen in the player code (https://www.youtube.com/yts/jsbin/player_ias-vflrnurMS/en_US/base.js) that the message is assigned to a constant called "TOO_MANY_REQUESTS_WITH_LINK" but there is no high volume of requests per user and the quota cannot be configured as in other Google APIs.

We follow the iFrame API reference: https://developers.google.com/youtube/iframe_api_reference?hl=en

<iframe id="player" src="https://www.youtube.com/embed/M7lc1UVf-VE?autoplay=1&amp;cc_load_policy=0&amp;controls=0&amp;disablekb=1&amp;enablejsapi=1&amp;fs=0&amp;iv_load_policy=3&amp;loop=0&amp;modestbranding=1&amp;playsinline=1&amp;rel=0&amp;showinfo=0&amp;wmode=transparent&amp;origin=XXX" frameborder="0"></iframe>

<script type="text/javascript">
    var player,
        scriptTag = document.createElement('script'),
        firstScriptTag = document.getElementsByTagName('script')[0];
    scriptTag.src = "https://www.youtube.com/iframe_api";
    firstScriptTag.parentNode.insertBefore(scriptTag, firstScriptTag);
    function onYouTubeIframeAPIReady() {
        var options = JSON.parse('{"autoplay":1,"cc_load_policy":0,"controls":0,"disablekb":1,"enablejsapi":1,"fs":0,"iv_load_policy":3,"loop":0,"modestbranding":1,"playsinline":1,"rel":0,"showinfo":0,"wmode":"transparent","origin":"XXX"}');
        if (!options.origin) {
            options.origin = location.origin ||
            location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
        }
        player = new YTRemoteVPlayer('player', '<%-videoId%>', options);
    }
</script>

Does anyone know what may be happening and how to fix it?

2
I am having the same issue on one Android app that uses the iFrame API. This bug started to happen on 19th of October. As you have said, I also could not figure out any pattern for this bug to happen, but it is reflecting in a lot of 1 stars. Searching on YouTube / Chromium forums, I could not find any answers / fixes =/Augusto Carmo
Teran, could you check and post here if the quantity of bad reviews related to that problem have reduced (or even zeroed) from yesterday to today? It seems like YouTube has resolved that problem. Thank you :)Augusto Carmo
Indeed, since yesterday we haven't got any error about this. Thanks for your help!angel.teran
It's happening again :(angel.teran
I've opened a new issue on issuetracker: issuetracker.google.com/issues/144057800Augusto Carmo

2 Answers

12
votes

Me and my teammates managed to reproduce that behaviour locally.

To reproduce that behaviour, all you need to do is, under the same IP Address, to load the youtube JS multiple times and for different videos. Although I cannot clarify the exact amount of times it must be done (we left some devices aside doing it), the behavior certainly happened.

As an attempt of a workaround for that problem, we accessed the https://web.archive.org/web website and fetched an old YouTube JS script (https://www.youtube.com/iframe_api). We tried to use that old script, but with no success. The message continued to appear =/.

I really do not know if there is much we, developers, can do about it, but wait for an YouTube statement and/or revision of recent changes on their end.


Update

There is an issue opened on Google's issue tracker website:


Update

It looks like that YouTube have resolved that problem on their end. We'll keep monitoring :)


Update (November 5th 2019)

The problem is happening again.


Update (November 7th 2019)

I have opened a new issue on issuetracker: - https://issuetracker.google.com/issues/144057800

3
votes

I don't have a fix for it, but I can add more information about the problem, this way maybe someone can help us with this issue.

I am getting the same error with some users, and like you said there is no a clear pattern. My devices are working properly, but I did some tests with the help of a user of my app that is getting this error. Following the results:

Demo used in my tests: https://developers.google.com/youtube/youtube_player_demo

Test 1 - Open the iframe player api demo on device's browser - WORKED

Test 2 - Open the iframe player api demo into a webview on my app - FAIL

Test 3 - Open the iframe player api demo into a webview on my app using a VPN connection - WORKED

So, it appears to be a combination of APP + IP is blocked. I don't know the reason, and it will be very helpful if someone repeat these tests. I am trying to confirm it with another user, but it's a little hard to find someone willing to help.

UPDATE: a second user tried to use a VPN and it worked to him too.

UPDATE 2: a user with this problem told me that the videos are working properly again now. It appears to be a temporary block by Youtube on server side.