Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion StreamingKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "StreamingKit"
s.version = "2.4.24"
s.version = "2.4.25"
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources."
s.homepage = "https://github.com/tumtumtum/StreamingKit/"
s.license = 'MIT'
Expand Down
15 changes: 10 additions & 5 deletions StreamingKit/StreamingKit/STKHTTPDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,13 @@ -(BOOL) parseHttpHeader

self->iceHeaderData = nil;
}

if (([httpHeaders objectForKey:@"Accept-Ranges"] ?: [httpHeaders objectForKey:@"accept-ranges"]) != nil)

NSString* range = ([httpHeaders objectForKey:@"Accept-Ranges"] ?: [httpHeaders objectForKey:@"accept-ranges"]);
if (range != nil && ![[range lowercaseString] isEqualToString: @"none"])
{
self->supportsSeek = YES;
}

if (self.httpStatusCode == 200)
{
if (seekStart == 0)
Expand All @@ -339,6 +340,8 @@ -(BOOL) parseHttpHeader
{
fileLength = [[components objectAtIndex:1] integerValue];
}

self->supportsSeek = YES;
}
else if (self.httpStatusCode == 416)
{
Expand Down Expand Up @@ -503,7 +506,7 @@ -(void) open

-(void) openForSeek:(BOOL)forSeek
{

@synchronized (self) {
int localRequestSerialNumber;

Expand All @@ -529,8 +532,10 @@ -(void) openForSeek:(BOOL)forSeek
if (seekStart > 0 && supportsSeek)
{
CFHTTPMessageSetHeaderFieldValue(message, CFSTR("Range"), (__bridge CFStringRef)[NSString stringWithFormat:@"bytes=%lld-", seekStart]);

discontinuous = YES;
} else if (seekStart == 0) {
CFHTTPMessageSetHeaderFieldValue(message, CFSTR("Range"), (__bridge CFStringRef)[NSString stringWithFormat:@"bytes=0-1"]);
}

for (NSString* key in self->requestHeaders)
Expand Down