davidohayon669 / react-native-youtube

A <YouTube/> component for React Native.
MIT License
1.16k stars 472 forks source link

An error occurred while initializing the youtube player #544

Open Snehalphutane opened 1 year ago

Snehalphutane commented 1 year ago

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 commented 1 year ago

same !!!

dellert commented 1 year ago

for android version >= 11 add `

` into your AndroidManifest file

shanujha commented 1 year ago

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

midhunem42 commented 1 year ago

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 commented 1 year ago

any soltion here yet

BilalTariq01 commented 1 year ago

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