Skip to content

Commit

Permalink
Merge pull request #11 from relivecc/incorrect-live-photo-fix
Browse files Browse the repository at this point in the history
use correct asset to get full paired video
  • Loading branch information
FrikkieSnyman authored Oct 21, 2019
2 parents 3ced455 + a380d70 commit c543fb4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ios/RNPhotosFramework/RNPFManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ -(void) updateAssets:(NSMutableArray<PHAsset *> *)assets andUpdateObjs:(NSDictio
}
PHAssetResource* videoResource = nil;
// Check if the new livephoto asset has a video part.
NSArray* assetResources = [PHAssetResource assetResourcesForAsset:asset];
NSArray* assetResources = [PHAssetResource assetResourcesForLivePhoto:livePhoto];
for(PHAssetResource* resource in assetResources) {
if (resource.type == PHAssetResourceTypeFullSizePairedVideo) {
videoResource = resource;
Expand All @@ -494,7 +494,6 @@ -(void) updateAssets:(NSMutableArray<PHAsset *> *)assets andUpdateObjs:(NSDictio
}
// if for some reason the fullSizeVideo does not exist, then fallback to the original video
if (!videoResource) {
assetResources = [PHAssetResource assetResourcesForLivePhoto:livePhoto];
for(PHAssetResource* resource in assetResources) {
if (resource.type == PHAssetResourceTypePairedVideo) {
videoResource = resource;
Expand Down

0 comments on commit c543fb4

Please sign in to comment.