Comments (13)
Add player vars
while initializing youtube sdk:
NSDictionary *playerVars = @{
@"origin" : @"http://www.youtube.com",
};
[self.playerView loadWithVideoId:@"KOvoD1upTxM" playerVars:playerVars];
Enjoy!
from youtube-ios-player-helper.
One option could be to just skip the video if you get an error message or load new one. You can do this by intercepting the YTPlayerView requests.. Example here!
from youtube-ios-player-helper.
Hi @JV17,
About this matter, I was wondering how you could detect that the content is forbidden in order to display a custom message inside the app when this is the case.
Indeed, I don't receive a callback from this delegate "- (void)playerView:(YTPlayerView *)playerView receivedError:(YTPlayerError)error", currently.
Thanks a lot for your help.
Best,
from youtube-ios-player-helper.
@Kowaio I will just check what it will get returned within the error or as mentioned above and then just trigger a function that will display this message everytime you get that response.
from youtube-ios-player-helper.
Your video is playing back fine for me using the latest YTPlayerView
classes.
- (void)viewDidLoad {
[super viewDidLoad];
NSDictionary *playerVars = @{
@"playsinline" : @1,
@"showinfo" : @0,
@"rel" : @0,
@"modestbranding" : @1,
@"controls" : @1
};
[self.playerView loadWithVideoId:@"ASM7f1E-dy8" playerVars:playerVars];
}
Logging:
2015-01-28 15:37:55.081 TestApp[2520:348788] YTPlayerView : playerViewDidBecomeReady
2015-01-28 15:37:55.082 TestApp[2520:348788] quality levels available:- (
7
)
2015-01-28 15:37:55.182 TestApp[2520:348788] YTPlayerView : didChangeToState
2015-01-28 15:37:55.622 TestApp[2520:348788] YTPlayerView : didChangeToQuality
2015-01-28 15:37:55.623 TestApp[2520:348788] kYTPlaybackQualityMedium
2015-01-28 15:38:00.113 TestApp[2520:348788] YTPlayerView : didChangeToQuality
2015-01-28 15:38:00.115 TestApp[2520:348788] kYTPlaybackQualityMedium
2015-01-28 15:38:00.135 TestApp[2520:348788] YTPlayerView : didChangeToState
2015-01-28 15:38:00.136 TestApp[2520:348788] Started playback
from youtube-ios-player-helper.
Hello @JALsnipe,
Mine was this one: JrGBmjtOKlM
However, I think that it cannot be played on mobile devices due to some restriction of the author. I might be wrong though.
@JV17: I succeeded to detect it on the didChangeToState callback by checking the "kYTPlayerStateUnstarted". Thanks again for your help.
Best,
from youtube-ios-player-helper.
Thanks for the new URL. It doesn't appear that I get any error callback when trying to load that video:
2015-01-28 15:50:28.017 TestApp[2529:350224] YTPlayerView : playerViewDidBecomeReady
2015-01-28 15:50:28.018 TestApp[2529:350224] quality levels available:- (
7
)
2015-01-28 15:50:28.096 TestApp[2529:350224] YTPlayerView : didChangeToState
2015-01-28 15:50:28.573 TestApp[2529:350224] YTPlayerView : didChangeToState
2015-01-28 15:50:28.573 TestApp[2529:350224] Player in Unstarted State
Maybe one of the other experts can chime in, but it looks like the class tries to play the video, something in the iFrame is blocking it, and the player returns to the unstarted state. I don't think there's any way to get around this embedded/mobile blocking
from youtube-ios-player-helper.
@JALsnipe: Yes indeed. I didn't received any error callback as well. Since I needed to detect it either way, the "Unstarted" state kind of does the trick in my case. For now...
But yeah, I think that this is coming from YT API and can't be overpassed.
from youtube-ios-player-helper.
The MAIN Problem is the video can be played on Android!!
So my company is developing an app for iOS and Android, basically it's an app to play curated video from Youtube.
And now I get this problem when certain video is playable on Android app but not in iOS app. If it is caused by restriction of the video how is it possible to be played on Android??
Here is my video "gKHQ715IMyc"
from youtube-ios-player-helper.
@atulvuliv thanks, that did it for me.
from youtube-ios-player-helper.
@atulvuliv
Thanks, your replay save my time.
from youtube-ios-player-helper.
@atulvuliv that doesn't work for me :(
for this videoId: 9VoHLolUaPc
from youtube-ios-player-helper.
Hey guys!
Any update on this issue why some videos are not playing in this video player whereas same videos being played using Android player.
for me this video is not being played. 6fvYcRdhuBE
from youtube-ios-player-helper.
Related Issues (20)
- Delegate doesn't call playerView(_ :, didChangeTo:) correct
- 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
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.