From 723df5d4ae825c2ffbbb20f0d856ee5d105a6af0 Mon Sep 17 00:00:00 2001 From: YasirYang Date: Wed, 31 Jan 2018 20:23:19 +0800 Subject: [PATCH 1/3] add ipod-library support --- Video.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Video.js b/Video.js index feb79861..2fa6ddfa 100644 --- a/Video.js +++ b/Video.js @@ -166,7 +166,7 @@ export default class Video extends Component { } const isNetwork = !!(uri && uri.match(/^https?:/)); - const isAsset = !!(uri && uri.match(/^(assets-library|file|content|ms-appx|ms-appdata):/)); + const isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/)); let nativeResizeMode; if (resizeMode === VideoResizeMode.stretch) { From 80b71b19228c019a391f50035694f5222951d4a5 Mon Sep 17 00:00:00 2001 From: YasirYang Date: Mon, 5 Feb 2018 21:04:07 +0800 Subject: [PATCH 2/3] fix crash bug --- ios/RCTVideo.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ios/RCTVideo.m b/ios/RCTVideo.m index 0f1227b1..e4548e72 100644 --- a/ios/RCTVideo.m +++ b/ios/RCTVideo.m @@ -732,7 +732,10 @@ static NSString *const timedMetadata = @"timedMetadata"; - (void)removePlayerLayer { [_playerLayer removeFromSuperlayer]; - [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; + @try{ + [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; + }@catch (NSException * e) { + } _playerLayer = nil; } @@ -823,7 +826,10 @@ static NSString *const timedMetadata = @"timedMetadata"; { [_player pause]; if (_playbackRateObserverRegistered) { - [_player removeObserver:self forKeyPath:playbackRate context:nil]; + @try{ + [_player removeObserver:self forKeyPath:playbackRate context:nil]; + }@catch (NSException * e) { + } _playbackRateObserverRegistered = NO; } _player = nil; From 3d40935cc192a95331e7a002f272eb8bca8df5b9 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Mon, 3 Sep 2018 18:30:19 -0700 Subject: [PATCH 3/3] Revert crash fix when removing player layer observer Couldn't figure out how this was happening, so I don't want to hide it with try/catch. Let's get it fixed instead. --- ios/RCTVideo.m | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ios/RCTVideo.m b/ios/RCTVideo.m index e4548e72..0f1227b1 100644 --- a/ios/RCTVideo.m +++ b/ios/RCTVideo.m @@ -732,10 +732,7 @@ static NSString *const timedMetadata = @"timedMetadata"; - (void)removePlayerLayer { [_playerLayer removeFromSuperlayer]; - @try{ - [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; - }@catch (NSException * e) { - } + [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; _playerLayer = nil; } @@ -826,10 +823,7 @@ static NSString *const timedMetadata = @"timedMetadata"; { [_player pause]; if (_playbackRateObserverRegistered) { - @try{ - [_player removeObserver:self forKeyPath:playbackRate context:nil]; - }@catch (NSException * e) { - } + [_player removeObserver:self forKeyPath:playbackRate context:nil]; _playbackRateObserverRegistered = NO; } _player = nil;