Spaces in local file paths don't work on iOS (#214)
https://github.com/ryanheise/just_audio/issues/208 Co-authored-by: Hoang Sang <buontaiviem@gmail.com>
This commit is contained in:
parent
c2e5dcd93a
commit
ef3a081b0d
|
@ -14,7 +14,7 @@
|
||||||
NSAssert(self, @"super init cannot be nil");
|
NSAssert(self, @"super init cannot be nil");
|
||||||
_uri = uri;
|
_uri = uri;
|
||||||
if ([_uri hasPrefix:@"file://"]) {
|
if ([_uri hasPrefix:@"file://"]) {
|
||||||
_playerItem = [[IndexedPlayerItem alloc] initWithURL:[NSURL fileURLWithPath:[_uri substringFromIndex:7]]];
|
_playerItem = [[IndexedPlayerItem alloc] initWithURL:[NSURL fileURLWithPath:[[_uri stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] substringFromIndex:7]]];
|
||||||
} else {
|
} else {
|
||||||
_playerItem = [[IndexedPlayerItem alloc] initWithURL:[NSURL URLWithString:_uri]];
|
_playerItem = [[IndexedPlayerItem alloc] initWithURL:[NSURL URLWithString:_uri]];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue