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

后端 未结 3 1196
日久生厌
日久生厌 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

提交回复
热议问题