[Free] Media Cache | Cache video and audio files to make your and users' life easier

Media Cache
Media cache is a simple extension based on Media Loader library that help to cache video and audio files to provide a smooth and friendly user experience. If your app loads videos or audio files from internet then media cache can help you to save user’s precious data and cache video or audio so you wont have to load it again. Once a media is fully cached you can use it even if the user is offline. Lets jump into docs.


Documentation

On Progress Changed

This block is triggered when loading progress is changed. You can use the values provided by this block for a better user experience

On Error

This block is triggered when there is an error while loading media

Initialize Media Cache

Use this block to initialize Media Loader. You need to initialize loader before using any other block.
Directory Name : Specify a name for caching folder
Max File Count : Maximum number of files that can be stored in cache folder
Max File Size : Specify maximum file size for cache file in Mbs
Max File Time Limit : No of days a file should be kept safe

Start Listener

Start download listener for a specific url

Stop Listener

Stop download listener for a specific url

Pause

Pause download for a specific url

Resume

Resume download for a specific url

GetUrl

Get a url that will be used by Media Loader library to cache file. You can pass the resulting url from this block as a source for the media player

Get Cache File Path

Get cache file path for a specific url

Is File Path

Check if a url is fully cached or not


Sample Video


Download
AIX File : com.dreamers.MediaCache.aix (111.0 KB)
AIA File : cacher.aia (113.7 KB)


You can use this extension with built in video player. You can also use it with my video player extension or atom developers video background extension.


Donations
If you like my free extensions and find them useful then you can donate to help me make more useful extensions. For further queries you can pm me.


I hope you find this extension useful. And as always I will be waiting for you super awesome reviews and suggestions.

32 Likes

Again You have launched a nyc extension!

2 Likes

Great work @zainulhassan. :+1:t2:

1 Like

Please add pdf file cache

can we use youtube video

You can use it with any direct video link

1 Like

Nice Extensions @zainulhassan :+1:

2 Likes

@zainulhassan You are always Epic :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

1 Like

Great extension

1 Like

Great extension.

Hello @zainulhassan this extension looks nice and I think this is what I have been looking for so that I can give my users to play video offline but I have the question!

1. Does this extension force the user do download the video so that the user will play it offline or after caching then it makes the video to play offline?

2. What is the real meaning of caching vs downloading?

My point is I don’t what the user to download the video because after they download it they will share the video so I want them to play only on my app but offline.

Have you understood what I mean? @zainulhassan

1 Like

Hello @zainulhassan how can I get this in listview?

You can use this block

1 Like

Yes I understand but can I use it with ColineTreen Listview after cached?

it doesn’t seem to be working for me. It comes back false still the file is in the folder.

1 Like

link dead can not dowload

which link are you talking about?
the link to the aix and example project from the first post of this thread are working for me: [Free] Media Cache | Cache video and audio files to make your and users' life easier

Taifun

1 Like

Hi,

I implemented this extension to my app. But there are some problems:

  1. It takes too long to start playing.

    I guess for big files it’s good, like a movie or a video, but in my case, I use it for music (~4MB audio files) which takes more time to play, than simply downloading the file and then playing it. Maybe this is because of problem #2:

  2. My server doesn’t provide Content-Length header, so the OnProgressChanged fires only at 100%. Perhaps this is why it takes so long to start playing the song. Is there some way to deal with this? In situations where the content-length is unknown?

  3. In older android phone (android 6.0.1) the music plays botched, like : starting, skipping 30s, playing 3s, skipping 30s, playing again, skipping again, the end. It seems like a problem with the encoding process perhaps? In newer android phones this didn’t happen.

  4. Most of the times, perhaps every time, the song plays to 60-70% and then just stops. Very weird, I thought it was because of my server’s headers, but it’s not. Also the cached file is complete, it’s just the .GetUrl that does this.

These problems made the extension unworkable for me. Although I love the concept. It’s extremely useful. So I’d like to hear from you.

Note: I used it on AI2, not Kodular.
Note 2: The aia demo doesn’t load in AI2. But the extension does. You might want to look at that.

Thank you very much
Fotios TSF Anonwins

edit: Also another thing: the GetCacheFilePath returns usually wrong path: it has .tmp in the end but the actual file is without .tmp, and other times the opposite. So I solved this by checking for both paths: with .tmp and without .tmp

yeah, I had the same problems. It just doesn’t work as it should

nice extension :heart: :heart: :heart: :heart: :heart: