0

I'm looking for a way to play a multimedia file saved in the ram memory of the mobile phone in flutter !. Apparently the video_player package does not accept files in memory but only files on ssd, asset or url. Do you know a way to do this in flutter?

Maurizio Mancini
  • 271
  • 4
  • 13

1 Answers1

0

Are you allowed to cache videos?

If yes, you could try using flutter_cache_manager to cache your videos and play them from the cache.

Do note that, as written in the package README:

By default the cached files are stored in the temporary directory of the app. This means the OS can delete the files any time.

Also check out this answer from a similar thread on stack overflow.

EDIT

Since it is required to not save the video on it could be an option to use the better_player, which has the option to read a video file directly from memory, using BetterPlayerDataSource.memory as the data source.

Refer to this section of the documentation for more info.

xaer
  • 195
  • 1
  • 12
  • thanks for the reply, but i really don't want to store them in the ssd memory of the device. – Maurizio Mancini Aug 11 '22 at 15:07
  • @MaurizioMancini I see, what about the [better_player](https://pub.dev/packages/better_player) package? It should have the BetterPlayerDataSourceType.MEMORY source type so you can pass it the video in bytes. – xaer Aug 11 '22 at 15:28