Open lurui1029 opened 3 years ago
Player stopped working when set up with an AVAsset downloaded from user's iCloud photo library using PHImageManager:
Player
AVAsset
PHImageManager
Error Domain=NSCocoaErrorDomain Code=257 UserInfo={NSURL=file:///var/mobile/Media/PhotoData/Metadata/DCIM/101APPLE/IMG_1858.small.MP4, NSUnderlyingError=0x2833487b0 {Error Domain=NSOSStatusErrorDomain Code=-12203 "(null)"}}
Related posts:
Swift AVAsset downloading from iCloud has no permission on iOS 14: error Code=257
Request AVAsset using iCloud PHAsset returns an AVAsset with no VideoTracks
Set up Player with an AVPlayerItem.
AVPlayerItem
PHImageManager provides either an AVAsset or an AVPlayItem for a video request from user's photo library. This issue does not occur when working with an AVPlayerItem.
AVPlayItem
Player
stopped working when set up with anAVAsset
downloaded from user's iCloud photo library usingPHImageManager
:Related posts:
Swift AVAsset downloading from iCloud has no permission on iOS 14: error Code=257
Request AVAsset using iCloud PHAsset returns an AVAsset with no VideoTracks
Solution
Set up
Player
with anAVPlayerItem
.PHImageManager
provides either anAVAsset
or anAVPlayItem
for a video request from user's photo library. This issue does not occur when working with anAVPlayerItem
.