Closed franciscorode closed 4 years ago
@franciscorode, Thanks for the PR. You can pass src
prop as 'https://www.youtube.com/embed/$ID?rel=0'
. I've just checked it out and it works.
Note: that you can't disable related videos referring to the docs.
After the change, you will not be able to disable related videos. Instead, if the
rel
parameter is set to0
, related videos will come from the same channel as the video that was just played.
I don't think it's a good idea to introduce a separate prop for every parameter, since it will make component really large. Moreover you can pass any of them via src
prop.
autoplay
and enablejsapi
props were introduce since they change the way how component behaves.
I understand your position, it's fine although I don't like the idea of passing options in the URL. I tried to pass the option in prop playerOptions
but I could not know why it did not work for me, other options work well such as events.
If you find of good way to pass options outside of the URL and without overloading the properties component let me know I'll be happy to help
@franciscorode, We can add parameters
prop, which can include all the parameters. All we need to do is correctly construct the URL.
Yes seem a good idea, I understand these points, tell me if you don't agree with some of them
Object
with a default empty objectplayerOptions
propsrcAttribute
will add each option to the URLenablejsapi
and autoplay
props should be passed only in this prop instead have own props, to don't break retrocompatibility will maintain them but we should add a warning about your deprecation with the objective of remove them in a future@franciscorode, awesome!
Good! I can work on this, give me a few days and create another pull request, close this
@franciscorode, Thank you so much. I will be glad to review your PR.
First, congrats by the repo! I tried to disable related videos by adding
rel
option inplayerOptions
withplayerVars
but for some reason, it didn't work, the only way to make it work was to add it as a GET parameter in thesrc
prop. To not set options in several sites I think is better to add it as a prop and I have added the changes to do it