react-youtube icon indicating copy to clipboard operation
react-youtube copied to clipboard

origin property in playerVars not working

Open khawerrind opened this issue 6 years ago • 3 comments

Hi, Thank you for the great library. I am trying to pass origin in the playerVars but it is not showing up in the iframe.

const opts = {
    height: '281',
    width: '500',
    playerVars: {
        autoplay: 0,
        rel: 0,
        origin: 'https://example.com'
    }
};

The origin in the src is still localhost

https://www.youtube.com/embed/8cyMWK4ZjT8?autoplay=0&rel=0&origin=http%3A%2F%2Flocalhost%3A8075&enablejsapi=1&widgetid=1

khawerrind avatar Jan 21 '19 15:01 khawerrind

We are not touching the contents of the playerVars so I'm not sure whats going on there... Maybe someone can jump in and look at whats going on?

tjallingt avatar Jan 21 '19 19:01 tjallingt

@khawerrind yes, sometimes works and sometimes not. But I can't understand the reason, I'll try see that later today.

Kappyh avatar Mar 08 '21 15:03 Kappyh

@khawerrind You already tried to config the origin with value: window.location.href ? Its working for me

Kappyh avatar Mar 09 '21 01:03 Kappyh