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:
hsangtini 2020-10-19 19:18:28 +07:00 committed by GitHub
parent c2e5dcd93a
commit ef3a081b0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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]];
} }