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

后端 未结 3 1135
日久生厌
日久生厌 2021-01-01 18:27

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 fu

相关标签:
3条回答
  • 2021-01-01 18:40

    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

    0 讨论(0)
  • 2021-01-01 18:56

    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.

    0 讨论(0)
  • 2021-01-01 19:00

    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 :(

    0 讨论(0)
提交回复
热议问题