Small code cleanup to setFilter
This commit is contained in:
parent
c2d9fb4301
commit
f401c6a287
@ -1288,17 +1288,13 @@ static int const RCTVideoUnset = -1;
|
|||||||
return;
|
return;
|
||||||
} else if ([[_source objectForKey:@"uri"] rangeOfString:@"m3u8"].location != NSNotFound) {
|
} else if ([[_source objectForKey:@"uri"] rangeOfString:@"m3u8"].location != NSNotFound) {
|
||||||
return; // filters don't work for HLS... return
|
return; // filters don't work for HLS... return
|
||||||
}
|
} else if (!_playerItem.asset) {
|
||||||
|
|
||||||
AVAsset *asset = _playerItem.asset;
|
|
||||||
|
|
||||||
if (!asset) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CIFilter *filter = [CIFilter filterWithName:filterName];
|
CIFilter *filter = [CIFilter filterWithName:filterName];
|
||||||
_playerItem.videoComposition = [AVVideoComposition
|
_playerItem.videoComposition = [AVVideoComposition
|
||||||
videoCompositionWithAsset:asset
|
videoCompositionWithAsset:_playerItem.asset
|
||||||
applyingCIFiltersWithHandler:^(AVAsynchronousCIImageFilteringRequest *_Nonnull request) {
|
applyingCIFiltersWithHandler:^(AVAsynchronousCIImageFilteringRequest *_Nonnull request) {
|
||||||
if (filter == nil) {
|
if (filter == nil) {
|
||||||
[request finishWithImage:request.sourceImage context:nil];
|
[request finishWithImage:request.sourceImage context:nil];
|
||||||
|
Loading…
Reference in New Issue
Block a user