-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only Downloading the Contents #6
Comments
Hi. If you want to download video file you can do it with NSURLRequest. After saving data to file you can play video from local URL. Example:
After downloading you can play it with:
Am I understand your question right? |
I want to pre cache the video . If some part of video has downloaded and
user clicked on that video then player should play first from the cache
then from network and also cache that video
…On Wed, 26 Sep 2018 at 9:41 PM, Vladislav Dugnist ***@***.***> wrote:
Hi. If you want to download video file you can do it with NSURLRequest.
After saving data to file you can play video from local URL. Example:
NSURL *url = [NSURL URLWithString:@"https://videos.bodybuilding.com/video/mp4/62000/62792m.mp4"];
NSURL *localURL = ...;
[[[NSURLSession sharedSession] dataTaskWithRequest:[NSURLRequest requestWithURL:url] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if (data) {
[data writeToURL:localURL atomically:YES];
}
}] resume];
After downloading you can play it with:
AVPlayer *player = [AVPlayer playerWithURL:localURL];
Am I understand your question right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Agpec_QsMfi_QFjcBkpWlMMoAl41AsItks5ue6c7gaJpZM4W6dPH>
.
--
Join ET Prime for fast, insight-rich analysis of news that matters to
you. Stay ahead with the story behind the story. ****
*Start Your 15-Day
Free Trial. Visit *ETPrime.com
<https://prime.economictimes.indiatimes.com/campaign?utm_source=Newsletter&utm_medium=email&utm_campaign=ETPrimeNewsletter&utm_content=Internal_Gmail_Footer_Message>********
**
|
replied in this issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi ,
Now able to download the contents instead of Playing . I am doing like this..
NSURL *url = [NSURL URLWithString:@"https://videos.bodybuilding.com/video/mp4/62000/62792m.mp4"];
DVURLAsset *asset = [[DVURLAsset alloc] initWithURL:url options:nil];
asset.loaderDelegate = self;
The text was updated successfully, but these errors were encountered: