How to remove "Watch again on YouTube" from youtube shorts played using react-native-webview #3063
pratteekshaurya1994
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using react-native-webview to play youtube videos on my react native app.
I wanted a feature where user wont be able to open youtube app or any thing else while watching video on my app. I am able to hide logo, share button, overflow menu and few other stuffs too.
But at the end of video a button popups called "Watch again on YouTube". I am able to hide it when normal youtube video is being played, but it still showing up when watching youtube shorts.
Below is my code:
i```
mport React from 'react';
import { WebView } from 'react-native-webview';
const YouTubePlayer = ({ videoId }) => {
const embedUrl =
https://www.youtube.com/embed/${videoId}?rel=0&modestbranding=1
;const injectedJavaScript = `
const hideElements = () => {
`;
return (
<WebView
source={{ uri: embedUrl }}
javaScriptEnabled={true}
injectedJavaScript={injectedJavaScript}
/>
);
};
Beta Was this translation helpful? Give feedback.
All reactions