YouTube tvOS URL Schema

I am trying to open a YouTube application from my application using the URL scheme or YouTube.com domain that opens the YouTube application directly on the iOS device.

This is the code I tried:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"youtube://results?search_query=trailer+%@",movieTitle]]]; 

and

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/results?search_query=trailer+%@",movieTitle]]]; 

But nothing works. Any ideas on how to get the URL scheme for the YouTube tvOS app?

+7
objective-c youtube tvos url-scheme
source share
2 answers

It is not necessary to consider this the β€œright” answer, but I think that all links to YouTube, at least on iOS, are processed by http , and not something like youtube:// .

Source (looks like since June 2015):

https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/YouTubeLinks/YouTubeLinks.html

-one
source share

I also ran into some problems playing youtube videos in youtube application, but I found a workaround, I used the XCDYouTubeKit library to play YouTube videos directly in my application. It is very easy to use and still works great.

XCDYouTubeKit: https://github.com/0xced/XCDYouTubeKit

-one
source share

All Articles