charmy / react-native-youtube-sdk Goto Github PK
View Code? Open in Web Editor NEWYouTube SDK for React Native
License: Apache License 2.0
YouTube SDK for React Native
License: Apache License 2.0
The play button appears on the center of the video but it's not pressable.
<YouTubePlayer
ref={ref => (this.youtubePlayerRef = ref)}
videoId={song.youtubeId}
style={{
flex: 1,
zIndex: 2
}}
autoPlay={false}
showPlayPauseButton={true}
showFullScreenButton={false}
showSeekBar={false}
onChangeState={this.onVideoStateChange}
onReady={this.onVideoReady}
onError={this.onVideoError}
/>
I'm using the latest version.
how to set resolution for react-native-youtube-sdk videos , the three dots as menu icon is not working. Then how this can be done.
Hi,
I encountered a problem with Android: It seems like is entering autoPlay even if it set to false.
Everything works perfect on iOs
Here is implementation:
<YouTubePlayer
videoId={videoId}
fullscreen
startTime={5}
style={{ width: '100%', height: isTalk ? 150 : 200 }}
onReady={(e) => console.log('onReady', e)}
onError={(e) => console.log('onError', e.error)}
onChangeState={(e) => console.log('onChangeState', e.state)}
onChangeFullscreen={(e) => console.log('onChangeFullscreen', e.isFullscreen)}
/>
versions:
react-native-youtube-sdk: 1.0.4
react-native: 0.60.6
error on app compile
"react-native": "0.66.1"
any help to sort this
Hi,
I encountered a problem with Android: If I have multiple youtube videos on the same page they are all entered in fullscreen on component mount if I set fullscreen to true.
Everything works perfect on iOs.
Maybe the resolution of this issue is related to the previous issue I encountered issue-35
Implementation:
<YouTubePlayer
videoId={videoId}
autoplay={false}
fullscreen
style={{ width: '100%', height: isTalk ? 150 : 200 }}
onReady={(e) => console.log('onReady', e)}
onError={(e) => console.log('onError', e.error)}
onChangeState={(e) => console.log('onChangeState', e.state)}
onChangeFullscreen={(e) => console.log('onChangeFullscreen', e.isFullscreen)}
/>
versions:
react-native-youtube-sdk: 1.0.9
react-native: 0.60.6
When video is playing in full screen mode and user clicks on notification.
the video keeps on playing on top of the notification landing screen.
Expected behaviour,
On click on notification, video should be closed
Null pointer exception -
om.srfaytkn.reactnative.YouTubeView.getYouTubePlayerProps() on a null object reference
FullScreenPlayerActivity.java at line 40 is returning null.
While pausing video a pop-up of Recommended Videos appears, How to keep them closed
On iOS 12.1, React 0.59.3, evertything works fine but audio on phone speakers. To hear the video sound track I need to connect some kind of headphones.
Is there something I am missing? Thanks
var playerVars:[String: Any] = [
"controls" : "0",
"showinfo" : "0",
"autoplay": "0",
"rel": "0",
"modestbranding": "1",
"iv_load_policy" : "3",
"fs": "0",
"ecver" : "2",
"playsinline" : "1"
]
The full screen button is hidden by the title and thumbnail.
But
Setting "showinfo" to an empty value causes the button to appear on the playbar.
Please fix the issue in the next version.
Not an issue.
This is just the best youtube player that avoids being restricted by youtube API.
THANK YOU ๐
Hi @srfaytkn,
I ran through your setup and have it working in iOS but the android setup doesn't seem to work. Current versions of react-native (I'm using 0.60.5) create a MainActivity.kt file instead of a MainApplication.java, how would I link this in Kotlin versus your instructions in Java? Thanks in advance!
Ben
it's fine when i play with offline video on andoird/ios, but live video is not show, please help me.
pls help
recent version , I can't play video on android, something wrong happened, i used example of lib , but it can't play on android, can anyone help me
I'm getting this compilation error in file YouTubeView.swift:
No such module 'YoutubePlayerView'
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-youtube-sdk": "^1.0.11"
when device orientation change the controls layout doesn't change to the new size unless its visible
Any Update on WkWebView implementation?
The Swift pod YouTubeSdk
depends upon React
, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers!
globally in your Podfile, or specify :modular_headers => true
for particular dependencies.
react native 0.59.10.
react: 16.8.3
react-native-youtube-sdk 1.0.4
Hi i Successfully installed in android and its working fine.
I am new in ios and xcode When i install in ios it's give flipper error
I am using version 0.59.10
Is it possible to build Android from this version?
how to set resolution for react-native-youtube-sdk videos , the three dots as menu icon is not working. Then how this can be done.
React Native version: 0.60.3
React : 16.8.6
Accessing view manager configs directly off UIManager via UIManager['YouTubeView'] is no longer supported. Use UIManager.getViewManagerConfig('YouTubeView') instead.
I would like to control playbackrate and quality of the video as well. Is there a way to do that ? @srfaytkn please do tell me if it is possible through this library. It would be great if we can achieve atleast one of them first
Heya - very good work. But if i change the the screen and go back, or come from another screen, then the video does not load.
react-native: v0.66.2
react-native-youtube-sdk: v1.0.12
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.utkarshbharat/com.srfaytkn.reactnative.FullscreenPlayerActivity}: android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
at com.srfaytkn.reactnative.FullscreenPlayerActivity.onCreate(FullscreenPlayerActivity.java:37)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f070064
at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:253)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:760)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:630)
at android.content.res.Resources.loadDrawable(Resources.java:886)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
at android.content.res.XResources$XTypedArray.getDrawable(XResources.java:1363)
at android.widget.ImageView.<init>(ImageView.java:188)
at android.widget.ImageView.<init>(ImageView.java:171)
at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:74)
at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:69)
at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:199)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:119)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.view.View.inflate(View.java:23239)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.DefaultPlayerUiController.<init>(DefaultPlayerUiController.kt:64)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.LegacyYouTubePlayerView.<init>(LegacyYouTubePlayerView.kt:53)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.LegacyYouTubePlayerView.<init>(LegacyYouTubePlayerView.kt:31)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView.<init>(YouTubePlayerView.kt:30)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView.<init>(YouTubePlayerView.kt:28)
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
at com.srfaytkn.reactnative.FullscreenPlayerActivity.onCreate(FullscreenPlayerActivity.java:37)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
below is my config, for some reason when switching to landscape, the player will not go into fullscreen. (I even confirmed that !isPortait() is true)
<YouTubePlayer ref={ytRef} videoId={id} autoPlay={false} fullscreen={!isPortrait()} showFullScreenButton={true} showSeekBar={true} showPlayPauseButton={true} startTime={5} style={{ width: "100%", height: 200 }} />
this is awesome btw!
Got an error when running pod install
The Swift pod `YouTubeSdk` depends upon `React`, which does not define modules
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
After creating a blank Swift File and creating a bridge header, then running pod install gave me the error above.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
simply create a new init rn project
install plugin
linked plugin
manually verify
and run
RN Version 0.59.5
Mac OSx Mojave
Xcode 11
iOS showFullScreenButton not display fullscreen button.
"react-native": "0.61.5",
"react-native-youtube-sdk": "^1.0.4",
Thank you for greate lib.
I met this issue when install your library.
YouTubeSdk
does not specify a Swift version.
Thank you for greate lib.
in this youtube player how we can set the playback speed to 2x ????????
It's not possible, Youtube iframe API does not support that features.
Originally posted by @ozgursoy in #46 (comment)
Youtube iframe API does provide playbackRate (speed) control. Please, look into this @srfaytkn https://developers.google.com/youtube/iframe_api_reference#Playback_rate
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.