0

am recording the video using camera plugin and saved the video in internal storage path then i have encoded video using base64.Now i need to decode the encoded value and play the decoded value in flutter application.If any one can help me. thanks in advance.

_fileConvert(String path) {
    File file = File(path);
    List<int> fileInByte = file.readAsBytesSync();
    String fileInBase64 = base64Encode(fileInByte);
    print("fileInBase64............");
    print(fileInBase64);

  }
Yuva
  • 121
  • 9
  • **(1)** If your coding language can use `base64Encode` then it should also have a `base64Encode` function available. **(2)** Once decoded, you'll likely have a **String** of hex numbers (byte values), but they need to be written into an array of type **uint8list**. Not sure how your string looks after decoding from B64. **(3)** Use a free tool like [BetterPlayer](https://github.com/jhomlala/betterplayer) which claims to handle playback of [video from bytes array](https://jhomlala.github.io/betterplayer/#/datasourceconfiguration). – VC.One Jan 13 '23 at 13:34
  • **PS:** If you don't need this to work on iOS then you can avoid using an external tool and use: **createURLfromBlob**, see [this other Answer](https://stackoverflow.com/a/65834130/2057709). – VC.One Jan 13 '23 at 13:38

0 Answers0