LonelyCpp / react-native-youtube-iframe

A wrapper of the Youtube-iframe API built for react native.
https://lonelycpp.github.io/react-native-youtube-iframe/
MIT License
594 stars 147 forks source link

How to disable watch on youtube from the iframe #309

Closed vijaykumar1710 closed 9 months ago

vijaykumar1710 commented 9 months ago

Describe the bug

How to disable watch on youtube from the iframe

I want to disable watch on youtube, watch later and share options from the iframe. Please guide me in doing this.

To Reproduce All videos by default has the watch on youtube, watch later and share options displayed on iframe

Expected behavior I want to disable all of them,

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

LonelyCpp commented 9 months ago

this was previously possible thru the modest branding prop. But youtube has since deprecated it and there's no way to prevent a user from sharing the video or hiding the "watch no youtube" button

https://developers.google.com/youtube/player_parameters#august-15,-2023

vijaykumar1710 commented 9 months ago

this was previously possible thru the modest branding prop. But youtube has since deprecated it and there's no way to prevent a user from sharing the video or hiding the "watch no youtube" button

https://developers.google.com/youtube/player_parameters#august-15,-2023

Atleast can we handle onclick from those UI parts in the library?

LonelyCpp commented 9 months ago

no this isn't possible. the player is rendered inside an iframe by youtube. injecting custom js into it will be unreliable.

you can try experimenting with the injectjavascript method