befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 354 forks source link

缓存功能怎么配置? #606

Open lurongshuang opened 1 year ago

lurongshuang commented 1 year ago

按照 评论中说的配置,发现并没有生效,是有问题吗?: await realPlayer.setLoop(0); await realPlayer.setDataSource("ijkio:cache:ffio:${video.url}", autoPlay: false, showCover: true);

  Directory directory = await getApplicationCacheDirectory();
  File cacheFilePath = File("${directory.path}/${video.fileName}.tmp");
  cacheFilePath.createSync();
  File cacheMapPath = File("${directory.path}/${video.fileName}._2.tmp");
  cacheMapPath.createSync();

  FijkOption fijkOption = FijkOption();
  fijkOption.setFormatOption("cache_file_path", "$cacheFilePath");
  fijkOption.setFormatOption("cache_map_path", "$cacheMapPath");
  fijkOption.setFormatOption("parse_cache_map", 1);
  fijkOption.setFormatOption("auto_save_map", 1);
  realPlayer.applyOptions(fijkOption);
hrhuang123 commented 5 months ago

后面你解决这个问题了吗