Code Monkey home page Code Monkey logo

firebase_cached_image's People

Contributors

bartdelange avatar charlescyt avatar imsamgarg avatar paitomax avatar thedalelakes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

firebase_cached_image's Issues

Questions about adding web caching

I was thinking of adding web caching to your plugin, but wanted to find out why this may not have been implemented already.

I was thinking of altering web_cache_manager.dart to convert the files to base64 for caching in sqflite, and decode from base64 for retrieval... or potentially just using a blob.

I was also thinking of using dart:indexed_db library for a more native web implementation according to this example, where video blobs are stored in the IndexedDB

Any thoughts on this? Web caching is important for my project. Just wanted to get any ideas or thoughts you may have already had before diving in.

Thanks!

Where it is cached

Hi everyone, i have a question

With this lib, these photo is cached when app is launched, and when app is kill, the cached is cleared
Or it is stilled cached although app is kill and just only clear if the clear code is called

Thanks

loadingBuilder support

Can't track image loading status because loadingBuilder doesn't return ImageChunkEvent

onError handling

Just implemented this to my project and getting great results so far. As a test I changed my url to be wrong and this causes an error of course. Is there a way to handle such an error with this package? If not what would be the best way to do so manually?

Thanks in advance

Support for firebase_storage 11.0.X

Because every version of firebase_cached_image depends on firebase_storage ^10.2.16 and depends on firebase_storage ^11.0.4, firebase_cached_image is forbidden.
So, because depends on firebase_cached_image ^0.3.1, version solving failed.

The method 'preCache' isn't defined

I got The method 'preCache' isn't defined for the type 'FirebaseCacheManager'

await FirebaseCacheManager().preCache(
          FirebaseUrl("gs://bucket_f233/profile_pic.jpg"),
);

Versions are as follows
firebase_cached_image : 0.4.2
Flutter 3.0.1 • channel unknown • unknown source
Tools • Dart 2.17.1 • DevTools 2.12.2

Unexpected behaviour by Source.cacheServer.

In our app we encountered an issue where a video stored on Firebase Storage would not play if it wasn't already cached locally. Instead of fetching and playing the video from the server, the app would display a black screen and log a "file not found" exception.

Here are the error logs for reference:

The error logs :

E/ExoPlayerImplInternal(12046): at android.os.Looper.loopOnce(Looper.java:201)
E/ExoPlayerImplInternal(12046): at android.os.Looper.loop(Looper.java:288)
E/ExoPlayerImplInternal(12046): at android.os.HandlerThread.run(HandlerThread.java:67)
E/ExoPlayerImplInternal(12046): Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /data/user/0/jp.smartbooks.kodomamo.parentapp/cache/flutter_cached_image/81361b96-0d8b-5910-a5be-251b14dd9261.mp4: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:203)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:114)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:263)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1005)

E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
E/ExoPlayerImplInternal(12046): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/ExoPlayerImplInternal(12046): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/ExoPlayerImplInternal(12046): at java.lang.Thread.run(Thread.java:1012)
E/ExoPlayerImplInternal(12046): Caused by: java.io.FileNotFoundException: /data/user/0/jp.smartbooks.kodomamo.parentapp/cache/flutter_cached_image/81361b96-0d8b-5910-a5be-251b14dd9261.mp4: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(12046): at libcore.io.IoBridge.open(IoBridge.java:574)
E/ExoPlayerImplInternal(12046): at java.io.RandomAccessFile.(RandomAccessFile.java:289)
E/ExoPlayerImplInternal(12046): at java.io.RandomAccessFile.(RandomAccessFile.java:152)
E/ExoPlayerImplInternal(12046): at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:184)
E/ExoPlayerImplInternal(12046): ... 8 more
E/ExoPlayerImplInternal(12046): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(12046): at libcore.io.Linux.open(Native Method)
E/ExoPlayerImplInternal(12046): at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
E/ExoPlayerImplInternal(12046): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
E/ExoPlayerImplInternal(12046): at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
E/ExoPlayerImplInternal(12046): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7756)
E/ExoPlayerImplInternal(12046): at libcore.io.IoBridge.open(IoBridge.java:560)
E/ExoPlayerImplInternal(12046): ... 11 more

To address this problem, we implemented a manual check to determine whether the video was already cached. If it was not found in the cache, we would explicitly set the source to Source.server. Conversely, if the video was cached, we used Source.cacheServer. This solution successfully resolved the playback issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.