I want to download a the video using web-view but I am not getting how to download it? my video link is here
the sample code for playing video which I am using is
-(void)embedYouTubeInWebView:(NSString*)url theWebView:(UIWebView *)aWebView {
NSString* html = [NSString stringWithFormat:@"%@", url];
[aWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:html]]];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self embedYouTubeInWebView:@"http://player.vimeo.com/video/32983838" theWebView:myWebView];
// Do any additional setup after loading the view, typically from a nib.
}
can anyone please help me to download this video?
To download a file i used the following Code. Hope it will work for you too.
- (IBAction)getFileFromFtpServer:(UIView *)sender
{
NSString *stringURL = @"http://player.vimeo.com/video/32983838";
NSURL *url = [NSURL URLWithString:stringURL];
NSData *urlData = [NSData dataWithContentsOfURL:url];
if ( urlData )
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"filename.mpeg4"];
[urlData writeToFile:filePath atomically:YES];
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With