Comments (10)
Hi @bpark93 Sorry for the slow response.
I tried it with this env, and am not able to reproduce it :(
"expo": "~37.0.3",
"react-native-webview": "8.1.1",
"react-native-youtube-iframe": "^1.2.4"
I also tried it on ios.
Are you using the player on a modal or any sort of overlay component?
There is a known bug in react-native-webview
right now, where fullscreen mode from a modal is buggy (for android only, iOS works good) link to issue
Can you try just a plain webview like and see what happens on fullscreen? The results should be identical for sanity's sake
<WebView
mediaPlaybackRequiresUserAction={true}
style={{ height: 240, width: 320, alignSelf: "center", alignContent: "center", }}
source={{ uri: `https://www.youtube.com/embed/${props.videoKey}?rel=0` }}
/>
from react-native-youtube-iframe.
Here's another issue that might help you can you try the orientation fix that is mentioned?
from react-native-youtube-iframe.
I have a similar issue. After switching fullscreen on and off the icons size remains the same as it was when fullscreen was on. But after some tests, it looks like this issue might be connected with the 16:9 aspect ratio of YoutubePlayer width and height.
For example, when width is 320 and height is 180 or width is 480 and height is 270 the bug with strange icons size occurs but when width is 325 and height is 180 the error is gone.
So maybe this is the thing that we need to pay attention to
from react-native-youtube-iframe.
For example, when width is 320 and height is 180 or width is 480 and height is 270 the bug with strange icons size occurs but when width is 325 and height is 180 the error is gone.
This fixes the video size issue for me too, but the app still freezes and the warning still pops up.
Hi @LonelyCpp , the video isn't on any overlay component. I'll try the other solution you posted.
from react-native-youtube-iframe.
So this is definitely some sort of screen orientation issue. I can reproduce thr exact same error using the expo video component.
I'm really curious as to how you can't reproduce the error at all on your end. Does your demo app have "orientation":"portrait"
in app.json? Are you using expo-screen orientation at all?
from react-native-youtube-iframe.
Does your demo app have "orientation":"portrait" in app.json?
Yes
- I tried it with the expo app from the playstore.
- Tried it with plain old react native app with orientation locked to portrait and unlocked (in AndroidManifest.xml)
- It seems like one can only build expo apps on expo servers 🤔 Let me try that too, just in case.
But all this is on an android 10 device. What android OS are you using?
from react-native-youtube-iframe.
@Foukz I can reproduce your bug with the specific width and height numbers. I am honestly perplexed, I'll see what I can find
from react-native-youtube-iframe.
Im experimenting the same bug
from react-native-youtube-iframe.
This issue has been fixed for me after a combination of @Razorholt 's fix in @LonelyCpp's second comment, using the onFullScreenChange prop from the fs-callback branch, and updating expo to 38. No more freezing, no more wacky video dimensions.
Use the onFullScreenChange prop to call a function that locks orientation and adjust video dimensions accordingly whenever entering/exiting fullscreen.
from react-native-youtube-iframe.
Keep a watch on fullscreen status, update width
on change so that iframe readjusts the size.
onFullScreenChange = (fullscreenStatus) => {
this.setState({ fullscreenStatus })
}
<YoutubePlayer
onFullScreenChange={this.onFullScreenChange}
width={this.state.fullscreenStatus ? 0 : videoWidth}
// ...other props
/>
works great
from react-native-youtube-iframe.
Related Issues (20)
- How to disable watch on youtube from the iframe HOT 3
- The Player is not shown when the parent View is aligned to center HOT 1
- SIGSEGV Error on android HOT 1
- React native FlatList last gallery item disappers after Youtube full screen
- Add enablejsapi property HOT 1
- Programmatically paused video shows a black screen instead of the paused video HOT 1
- height is not working HOT 1
- How to toggle fullscreen programmatically HOT 1
- Video Unavailable - Video is restricted Error HOT 5
- Add a fullscreen prop to control the fullscreen state from outside the component HOT 1
- Android devices crash when YouTubeVideoPlayer is on screen with expo-router navigation HOT 1
- Android only - Encountered an error loading page HOT 5
- How to resume music played in background by other app, after my app finishes playing own file
- Android!!! App getting exited without any console error while scroll down. (YoutubePlayer) HOT 2
- Hide title and share HOT 1
- Bug Version Android HOT 2
- Portrait Viewports HOT 1
- Possible to move the header to the bottom? HOT 1
- onChangeState with Flatlist is not working HOT 2
- Zooming not working once the video starts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-youtube-iframe.