It's Possible. However, for the purpose of your YouTube video if you like I do not want to recommend. becauseof following Youtbe TOS.
For the following reasons:
22.4
We found that your app contains information that may allow its users
to download YouTube content, which is not in compliance with the
YouTube Terms of Service.
"...You shall not download any Content unless you see a "download" or
similar link displayed by YouTube on the Service for that Content. You
shall not copy, reproduce, distribute, transmit, broadcast, display,
sell, license, or otherwise exploit any Content for any other purposes
without the prior written consent of YouTube or the respective
licensors of the Content. YouTube and its licensors reserve all rights
not expressly granted in and to the Service and the Content."
also refer following site question. that's very important. you will definitely need to read.
http://www.iphonedevsdk.com/forum/business-legal-app-store/88260-youtube-downloader.html
Anyway, now I'll tell you about how to implement them.
a. Streaming Service is not difficult to implement. According to Apple's sample code can be easily implemented. Please note the following. this using a AVPlayer. at 3G, Wifi i tested. it' fine. how to test? upload to video your server or get video link. and copy and paste in source code xib textField.
StitchedStreamPlayer
b. Video downloads are available at the same time. I will recommend AFNetworking. ARC support for it. so if apps state is the background, download continue.
AFNetworking
How to Download?
NSURLRequest *request = [NSURLRequest requestWithURL:"your_http_video_url" cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:20];
AFURLConnection *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [[docPaths objectAtIndex:0] stringByAppendingPathComponent:"your_save_video_name.mp4"];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:path append:NO];
[operation setDownloadProgressBlock:^(NSInteger bytesRead, long long
totalBytesRead, long long totalBytesExpectedToRead)
{
//do stuff. about upadte progressbar...
}];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSLog(@"downloadComplete"); // show alertView to user.
}];
[operation start];