Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions PersistentStreamPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,27 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
}
}

- (void)connection:(NSURLConnection *)connection
didFailWithError:(NSError *)error{

for (AVAssetResourceLoadingRequest *loadingRequest in self.pendingRequests) {
NSURLComponents * component = [[NSURLComponents alloc] initWithURL:loadingRequest.request.URL resolvingAgainstBaseURL:NO];
component.scheme = self.originalURLScheme ?: @"http";

if ([component.URL.absoluteString isEqualToString: connection.currentRequest.URL.absoluteString] ) {
[loadingRequest finishLoadingWithError:error];
[self.pendingRequests removeObject:loadingRequest];
}
}

if ([self.pendingRequests count] == 0) {
if ([self.delegate respondsToSelector:@selector(persistentStreamPlayerDidFailToLoadAsset:)]) {
[self.delegate persistentStreamPlayerDidFailToLoadAsset:self];
}
}

}

- (float)volume
{
return self.player.volume;
Expand Down