Comments (2)
Actually no, workaround:
- (void)initializateYTPlayerViewInView:(UIView *)view {
NSDictionary *playerVars = @{@"controls" : @1,
@"playsinline" : @1,
@"autohide" : @1,
@"modestbranding" : @1,
@"iv_load_policy" : @3,
@"rel" : @0};
self.YTPlayerView = [YTPlayerView new];
self.YTPlayerView.frame = view.bounds;
self.YTPlayerView.delegate = self;
[view addSubview:self.YTPlayerView];
[self.YTPlayerView loadWithVideoId:@"OG2eGVt6v2o" playerVars:playerVars]; // Initialize player
}
- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView {
[self.YTPlayerView loadVideoById:@"OG2eGVt6v2o" startSeconds:0.0f suggestedQuality:kYTPlaybackQualitySmall]; // Force awful quality at start
}
- (IBAction)changeQualityAction:(id)anObject {
[self.YTPlayerView loadVideoById:@"OG2eGVt6v2o" startSeconds:self.YTPlayerView.currentTime suggestedQuality:kYTPlaybackQualityHD720]; // Force HD Quality
}
Edited: oh yeah, they can force Medium quality, if your view doesn't fit HD quality size. But this workaround can help, if you gonna use lower qualities @ fullscreen.
from youtube-ios-player-helper.
Hello @chiakie
I did a lot of research and tests too regarding this matter since I'd like to play a video in hd720 quality in portrait mode (with width = 375 height = 210 in my case) in order for it to not reload when rotating my device and so playing the video in the new width = 667 height = 375 (iPhone6).
However, I didn't find anything that works. The YT iframe API seems to force the reload as soon as the resolution changes, so I'm hitting a wall too here.
Another member told me that it is the correct behavior on iPhone to avoid playing a kickass quality for 3G/LTE network. However I think that forcing a reload when the user rotates its device (since we're resizing the view) is also intrusive and not smooth imho.
I hope this will be fixed soon or that a solution will present itself.
Feel free to comment our posts if anyone's got an input about that.
Thanks again,
Best regards,
K
from youtube-ios-player-helper.
Related Issues (20)
- A Quality Video of Streaming Youtube's Video Not Properly
- Crash: [AVPlayerController boolValue]: unrecognized selector sent to instance
- YouTubeiOSPlayerHelper - When calls the 'Load' method (Xcode 14.2 - Target iOS 15)
- https://youtu.be/kXz8mD3Q_Lk
- youtube-ios-player-helper multiple audio selection
- Give us the bulk like functionality YOUTUBE!
- YouTube
- Youtube playsinline does not work for iPad
- It will lead App crash after update xcode
- YouTube
- Live label not showing on player for iphone.
- memory issue
- Fix Nullabilty warnings: Implicit conversion from nullable pointer 'X' to non-nullable pointer type 'Y' HOT 1
- Infinite loader when trying to play video
- WebKit`WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen App Crash
- i'm HOT 2
- Privacy manifest HOT 1
- Memory leak issue when calling StopViedo()
- Youtube
- Collapse the parent view of YTPlayerView when picture in Picture is enabled
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 youtube-ios-player-helper.