react-native-create-thumbnail: [iOS] Rendering the thumbnail throws an error

The function on iOS throws an error as follows:

[Error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (1718449215), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x600001cd4390 {Error Domain=NSOSStatusErrorDomain Code=1718449215 "(null)" UserInfo={AVErrorFourCharCode='fmt?'}}}]

I have used the following code under the useEffect.

createThumbnail({
  cacheName: attachment.title,
  format: 'png',
  url: attachment.asset_url,
})
  .then((response) => {
    setThumbnail(response.path);
  })
  .catch((error) => {
    console.log(error);
  });

On Android, it works well without any issues.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Changing my source path from file:///Users/.... to /Users/... worked.

Change createThumbnail({ url: sourcePath, timeStamp: 10000 }) to createThumbnail({ url: sourcePath.replace('file://', ''), timeStamp: 10000 })

@souvik-ghosh It is not playable for me. Thats why I placed this issue link here