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

Sign in to confirm you're not a bot

Open ilchoTaleski opened this issue 1 year ago • 9 comments

Describe the bug I am using react-native-youtube-iframe in my react native mobile app and up until now I had no issues embedding youtube videos. We had iOS app released at first and just two months ago we released the android app, as well. Now, one user complained about not being able to watch the videos on the app. They got the message: Sign in to confirm you are not a bot.

Here is part of my code using the library:

import YoutubePlayer from 'react-native-youtube-iframe';

...

<YoutubePlayer
    height={hProp || videoHeight}
    width={wProp || videoWidth}
    play={playing}
    videoId={videoYoutubeId}
    onChangeState={handleStateChange}
    ref={playerRef}
    onReady={handleReady}
    initialPlayerParams={{
        rel: false,
    }}
/>

This is how I am extracting the videoId from the youtube link (the youtube links are fetched from my database)

const videoYoutubeId = getSearchParamFromURL(
    video.youtubeLink,
    'v'
);

And this is the function:

export const getSearchParamFromURL = (url, param) => {
    const include = url.includes(param);

    if (!include) return null;

    const params = url.split(/([&,?,=])/);
    const index = params.indexOf(param);
    const value = params[index + 2];
    return value;
};

To Reproduce I cannot reproduce the behaviour. Based on user report, they cannot access any of the videos that are on the app. It is working for iOS devices and currently we have only one user that reported this issue on their android device.

Screenshots This is what they sent to us: 462549510_1605449763342599_8145747988130672576_n

Smartphone:

  • Device: Galaxy A54 5G
  • OS + version: Android 13
  • react-native-youtube-iframe version: ^2.3.0
  • react-native-webview version: ^13.3.1

I would really need to fix this issue, since users are subscribed and paying to watch videos on the app.

ilchoTaleski avatar Oct 18 '24 04:10 ilchoTaleski

Same here

evgeny-ykm avatar Nov 03 '24 14:11 evgeny-ykm

Anymore info here? Any workarounds?

paulsizer avatar Nov 28 '24 12:11 paulsizer

same here

Screenshot 2024-12-05 at 11 11 25

lutfi-haslab avatar Dec 05 '24 04:12 lutfi-haslab

I'm also facing this issue on android

Riyaancode avatar Feb 21 '25 11:02 Riyaancode

I meet this issue on android

mahaaoo avatar Mar 10 '25 10:03 mahaaoo

I meet this issues on Firefox browser in my react web application

ramses44-17 avatar Mar 14 '25 17:03 ramses44-17

Hi 👋 Just wanted to chime in here as we’ve run into the same issue in our app using react-native-youtube-iframe.

“Sign in to confirm you are not a bot” …when trying to play some embedded YouTube videos on Android/iOS. After some investigation, I found this is not a bug in the library, but rather a restriction enforced by YouTube itself.

🔍 Key Findings: • This usually happens when the video being embedded: • Is age-restricted • Has sign-in requirements • Is affected by Restricted Mode or network-level content filtering • YouTube may also prompt this when it suspects bot-like behavior from embedded players or unauthenticated WebViews.

Unfortunately, there’s no programmatic way to bypass this — it’s enforced by YouTube to comply with their policies around content access, privacy, and bot protection.

✅ Useful References: • YouTube Help – About Restricted ModeAge-restricted content policy

I recommend testing affected videos in an incognito browser or via https://www.youtube.com/embed/VIDEO_ID to verify if the restriction exists outside the app as well.

Hope this helps clarify things for anyone else facing the same issue. Thanks to the maintainers for this great library — just adding some context in case others come across this and are wondering what’s going on.

engineer-dilnawaz avatar Apr 30 '25 09:04 engineer-dilnawaz

Hello, this error message ("Sign in to confirm you're not a bot") tends to occur more frequently when a VPN is enabled.

sinankarakok avatar Jul 24 '25 10:07 sinankarakok

I agree with @sinankarakok . It is definitely a networking problem coming from YouTube and has nothing to do with the YouTube client itself. Seems to be VPN related.

K-E-L avatar Aug 12 '25 00:08 K-E-L