17

My app at http://beta.billboard.fm is producing errors in my normal browsing session after playing a single song.

If i reload the page in incognito, the app works fully. I only recently starting experiencing these issues. I have completed cleared all of the cache and it works again, but only temporarily before throwing the same errors.

Additionally I have disable all browser extensions.

But, no matter what I do I can't get this error from being thrown by the Youtube API:

Unable to post message to http://www.youtube.com. Recipient has origin https://www.youtube.com

It looks like there is a mismatch in the security protocols. I tried changing them to https or just removing "http:" all together on my side. But it did not resolve the issue.

Any one have an idea what is happening here?

thisissami
  • 15,445
  • 16
  • 47
  • 74
Jeff Callahan
  • 1,281
  • 12
  • 15

3 Answers3

4

It is quite clear to me at this point that this is a major bug in Google/YouTube's API. They have written some bad code somewhere. This bug is not a consistent thing. This is well documented by the fact that everybody's code works just fine for an extended period of time, and then they discover that all of a sudden their sites stop working properly. Additionally, all of my websites that had this problem last week are now working without a glitch - again, without me altering code.

So while it sucks to say this - the onus is on Google & YouTube to fix this and provide APIs that actually work as advertised... It doesn't look to me like there's anything we can do about it on our own :(

thisissami
  • 15,445
  • 16
  • 47
  • 74
3

I am having the same problem - I also tried changing my links to http: to https: and vice-versa with no luck. I found this tread on Google Groups, but so far there has been no response. https://code.google.com/p/gdata-issues/issues/detail?id=4697

Clearing my cache allowed the player to work for a few videos, but after 3 or 4, the same error pops back up.

poulified
  • 63
  • 6
  • Thanks, I'll keep an eye on this...let me know if you figure something out – Jeff Callahan Nov 20 '13 at 18:06
  • 1
    It's been over a month now since I first noticed this issue, and little has changed. However, there will be periods of days or weeks where no issues occur, and then the issue will suddenly pop back up. This occurs with no code changes on my end, so it seems that Google is tinkering with their API and not really letting us know. – poulified Dec 30 '13 at 16:43
  • I just want to comment that I haven't seen the errors discussed in a number of months - perhaps Google has cleaned up this bug? – poulified May 12 '14 at 19:36
3

UPDATE 2 - Dec. 24, 2013: This solution has not actually fixed the problem at all:

After following a thread that poulified referred me to in his answer, a user in the forum posted the following solution which seems to be doing the trick for me (UPDATE: Still experiencing issues on random page loads :/):

Hi all,

It is working for replacing http:// with https://

example: http://jsfiddle.net/8tkgW/29/

Please make sure the following tips

  1. load iframe api https://www.youtube.com/player_api
  2. load iframe src path: https://www.youtube.com/embed/0GN2kpBoFs4?rel=0

If load player via new YT.Player, you must check the iframe src path:

setTimeout(function(){
    var url = $('#iframe_youtube').prop('src');
    if (url.match('^http://') {
        $('#iframe_youtube').prop('src', url.replace(/^http:\/\//i, 'https://'));
    }
}, 500);

Please refer my github project:

https://github.com/appleboy/js-video-player/blob/master/js/jsplayer.js#L120

Community
  • 1
  • 1
Jeff Callahan
  • 1,281
  • 12
  • 15
  • Update: I am still actually experiencing some issues, but it is more consistent than before. If I experience an issue, a couple of page refreshes usually does the trick. – Jeff Callahan Nov 22 '13 at 06:27
  • Now, not working the majority of the time. But, maybe this will work for other folks. – Jeff Callahan Nov 22 '13 at 18:41
  • hey guys - i just stuck a bounty onto this because I am dealing with the same issues and am very frustrated by them. Question for anybody - is there any way I can edit the bounty message? I had line breaks in there for ease of use that didn't get formatted. as such, I'd like to add some "||||||" or something to separate the paragraphs out, just to make it more readable. – thisissami Dec 16 '13 at 22:53
  • @thisissami I can't reproduce your problem; I've checked your URLs, followed the google groups thread and checked all the URLs there, reloaded multiple times in multiple browsers, and haven't found a failed video yet. Jeff Callahan -- the code you've taken and implemented above isn't doing anything at all, because it has a syntax error; you need a second closing parenthesis on your if statement before the curly brace. However, even with that error I still couldn't get any of your videos to fail. Perhaps specific details of a single page and single browser version that fails consistently? – jlmcdonald Dec 18 '13 at 17:31
  • @jlmcdonald, The specific page is http://beta.billboard.fm (or any of the subpages) and I am on Chrome Version 31.0.1650.63 m, using Windows 7, Service Pack 1. I hope this helps. It seems to work for other people and then some others it doesn't. It seems random on the onset, but I'm sure I'm missing some commonality. – Jeff Callahan Dec 19 '13 at 00:17
  • @jlmcdonald et al - so it seems that this is entirely a Google/YouTube error - this bug seems to take place COMPLETELY randomly, and completely independently of following API specs. Sometimes the API acts this way, and sometimes it doesn't - it seems to be completely arbitrary. Right now all my sites are working completely fine for me too without issue... it is very frustrating to have to deal with the uncertainty of whether or not the video will work... – thisissami Dec 19 '13 at 18:41