capacitor-community / video-recorder

A video recording plugin for Capacitor
MIT License
3 stars 6 forks source link

The recorded video file result couldn't be readed/opened on iOS #9

Open novalbayusetiawan opened 1 month ago

novalbayusetiawan commented 1 month ago

Describe the bug I Cannot get recorded video file with Capacitor plugin Filesystem?

To Reproduce Steps to reproduce the behavior:

  1. this is videoUrl output on iOS 17: capacitor://localhost/_capacitor_file_/private/var/mobile/Containers/Data/Application/D143EA6E-D71D-47D1-9897-4211FC42B076/tmp/9F33AED5-9F9F-437A-AAD0-8DCAF54409CC.mp4
  2. trying to read file: let result = await Filesystem.readFile({ path: videoUrl.value!, })
  3. got error in xCode log: [error] - {"errorMessage":"The file “9F33AED5-9F9F-437A-AAD0-8DCAF54409CC.mp4” couldn’t be opened."}

Expected behavior can read the recorded video file

Smartphone :

shiv19 commented 1 month ago

Hi @novalbayusetiawan You will only need to pass the part after the _capacitor_file_ to the Filesystem.readFile method.

The videoUrl you receive is constructed such that you can directly pass it to a html video element. If you are looking to access the file path on the native side, all you need to do is split the videoUrl by _capacitor_file_ and access the 2nd item in the array.