Post

Replies

Boosts

Views

Activity

Reply to AVAssetResourceLoaderDelegate and TS files error: Error Domain=CoreMediaErrorDomain Code=-12881 "custom url not redirect"
Okay. I will try with AVAssetDownloadTask. I have a question can we do like this using AVAssetResourceLoadingRequest for .ts  NSString * fileExists = [[DownloadManager sharedManager] fileFullPathOfURL:contentURL];     if ([[NSFileManager defaultManager]fileExistsAtPath:fileExists] && loadingRequest.dataRequest) { NSData *tsData  = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:fileExists]];  [loadingRequest.dataRequest respondWithData:tsData];         [loadingRequest finishLoading];         return TRUE; } If I am returning the cached .ts file data then I am getting the error: Error Domain=CoreMediaErrorDomain Code=-12881 "custom url not redirect"
Jun ’20
Reply to AVAssetResourceLoaderDelegate and TS files error: Error Domain=CoreMediaErrorDomain Code=-12881 "custom url not redirect"
Thanks for your quick reply. I am creating manifest file by myself and also downloading all the .ts files in advance . When user clicks on a video for play then I will pass manifest file data to player using Assetdelegate and ts data if file has downloaded otherwise with valid url so that play can play that ts file from server not from cache . I am using custom schemes so that I am getting call-backs in asset delegates . I have already manifest files data & dummy m3u8 url with custom scheme. I want to pre-cache some portion of video .
Jun ’20
Reply to AVAssetResourceLoaderDelegate and TS files error: Error Domain=CoreMediaErrorDomain Code=-12881 "custom url not redirect"
Thanks for your reply. I am creating a custom playlists (m3u8) & passing it to player and it is working fine with the custom scheme. In this method "shouldWaitForLoadingOfRequestedResource" when there is a call for ts segment with the custom scheme . I am replacing the custom scheme with the https.  NSURLRequest *redirect = nil; NSString *url = loadingRequest.request.URL.absoluteString;  NSRange tldr = [url rangeOfString:@"//"];     if (![url hasPrefix:@"http"] && tldr.location != NSNotFound) {         url = [url stringByReplacingCharactersInRange:NSMakeRange(0, tldr.location) withString:@"https:"];     }     redirect = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];  [loadingRequest setRedirect:redirect];   NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:[redirect URL] statusCode:302 HTTPVersion:nil headerFields:nil];              [loadingRequest setResponse:response];              [loadingRequest finishLoading]; and it is working fine .. My question is how I can pass downloaded ts file. if there is a downloaded ts then return that otherwise do above step
Jun ’20