From ef3a081b0d6e7a127882d5eb02a6870071a3d670 Mon Sep 17 00:00:00 2001 From: hsangtini Date: Mon, 19 Oct 2020 19:18:28 +0700 Subject: [PATCH] Spaces in local file paths don't work on iOS (#214) https://github.com/ryanheise/just_audio/issues/208 Co-authored-by: Hoang Sang --- just_audio/darwin/Classes/UriAudioSource.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/just_audio/darwin/Classes/UriAudioSource.m b/just_audio/darwin/Classes/UriAudioSource.m index cd6edf7..f03aa9e 100644 --- a/just_audio/darwin/Classes/UriAudioSource.m +++ b/just_audio/darwin/Classes/UriAudioSource.m @@ -14,7 +14,7 @@ NSAssert(self, @"super init cannot be nil"); _uri = uri; 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 { _playerItem = [[IndexedPlayerItem alloc] initWithURL:[NSURL URLWithString:_uri]]; }