Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while initializing the youtube player #544

Open
Snehalphutane opened this issue Nov 17, 2022 · 6 comments
Open

An error occurred while initializing the youtube player #544

Snehalphutane opened this issue Nov 17, 2022 · 6 comments

Comments

@Snehalphutane
Copy link

i installed latest react-native-youtube version 2.0.2. but when i click on video from react native app it shows get youtube app. Before updating version it was working fine. video was playing within the project.

my code:
<YouTube
ref={youtubePlayerRef}
// You must have an API Key
apiKey={API_KEY}
videoId={"AhRE9ExeyV4"}
play={isPlaying}
loop={isLooping}
fullscreen={false}
controls={2}
style={[

            ]}
            showinfo={false}
            rel={false}
            showFullscreenButton={false}
            modestbranding={false}

            onError={e => setError(e.error)}
            onReady={e => setIsReady(true)}
            onChangeState={e => setStatus(e.state)}
            onChangeQuality={e => setQuality(e.quality)}
            onChangeFullscreen={e => {
              console.log(props.route.params.data
            }}
  
            onProgress={e => console.log(e)}
          />

package.json
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.11",
"@react-native-community/datetimepicker": "^6.7.0",
"@react-native-community/geolocation": "^3.0.3",
"@react-native-masked-view/masked-view": "^0.2.8",
"@react-native-picker/picker": "^2.4.8",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/material-top-tabs": "^6.3.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.1",
"deprecated-react-native-prop-types": "^2.3.0",
"moment": "^2.29.4",
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-android-location-enabler": "^1.2.2",
"react-native-calendars": "^1.1291.1",
"react-native-countdown-component": "^2.7.1",
"react-native-document-picker": "^8.1.2",
"react-native-image-picker": "^4.10.1",
"react-native-image-slider-box": "^2.0.7",
"react-native-image-viewing": "^0.2.2",
"react-native-linear-gradient": "^2.6.2",
"react-native-maps": "^1.3.2",
"react-native-modal-selector": "^2.1.2",
"react-native-pager-view": "^6.1.0",
"react-native-paper": "^4.12.5",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.18.2",
"react-native-skeleton-placeholder": "^5.2.4",
"react-native-snackbar": "^2.4.0",
"react-native-tab-view": "^3.3.0",
"react-native-vector-icons": "9.2.0",
"react-native-video": "^5.2.1",
"react-native-video-controls": "^2.8.1",
"react-native-youtube": "^2.0.2",
"rn-fetch-blob": "^0.12.0"
},

@nguyenanhtuan0799
Copy link

same !!!

@dellert
Copy link

dellert commented Dec 16, 2022

for android version >= 11 add
<queries> <intent> <action android:name="com.google.android.youtube.api.service.START"/> </intent> </queries>
into your AndroidManifest file

@shanujha
Copy link

shanujha commented Jul 7, 2023

We have the same problem as well, and adding the queries does not work still.

@midhunem42
Copy link

We have the same problem as well, and adding the queries does not work still.

Do you have any resolution? I am experiencing the same issue.

@equilizer
Copy link

any soltion here yet

@BilalTariq01
Copy link

Add the below lines of code into your AndroidManifest.xml file

<queries>
   <intent>
      <action android:name="com.google.android.youtube.api.service.START" />
   </intent>
</queries>

https://stackoverflow.com/questions/29133874/android-youtube-api-an-error-occurred-while-initializing-youtube-player/66330541#66330541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@dellert @equilizer @midhunem42 @nguyenanhtuan0799 @shanujha @Snehalphutane @BilalTariq01 and others