Cache videos on browsers

Miguel Quintana
Miguel Quintana used Ask the Experts™
on
Hello,

Is it possible to load videos on my web app (without playing them) then if I loose my internet connection I can play them from a kind of cache in the browser?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Download to your download folder and play with your movie player.

Author

Commented:
Yes, but I have javascript code associated for every single video on the web page, so cannot use movie player but a embed web player
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Most videos are much too large for any browser cache, so you need to be sure you maintain a connection.
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Alexandre SimõesManager / Solutions Architect

Commented:
That's the point, you won't have enough space to store a video on Local Storage.

If you go here and have a look at the Storage Size section you'll see:
Storage size[edit]
Web storage provides far greater storage capacity (5 MB per origin in Google Chrome,[6] Mozilla Firefox,[7] and Opera; 10 MB per storage area in Internet Explorer;[8] 25MB per origin on BlackBerry 10 devices) compared to 4 kB (around 1000 times less space) available to cookies.
So before even thinking about how to technically do it, you have a big upfront storage constraint.

Bottom line, if you want to see it offline, download it!

If you have some sort of javascript associated with the file, what's it's purpose?
If it's to identify the file to be played, then you can also execute it upon the download action, if it's something you want to do while playing and you still want to work offline, maybe you can think about a browser plugin?

Author

Commented:
The case of use is as following:

You have a surface tablet connected to a streaming server whithing a local network.

From the table I request 3 or 4 clips from the video that is being capturing on the server, each clip may last 5~8 sec aprox.

Then the software running on the server make the small clips and save then into a root folder in localhost

I have a dynamic html with all clips listed and the corresponding metadata/name of each clip.

If the user click on play button the clip has to be played on demand while it has a wifi connection to the local server

If user go outside the wireless radio and loose connection I need him to keep playing any video on demmand

That's why I need to have those videos cached locally and ready to be played from the html file
Manager / Solutions Architect
Commented:
If user go outside the wireless radio and loose connection I need him to keep playing any video on demmand
This is not possible, at least not with pure web technology.
For this to work you need to store the video file(s) in the user local disk and browsers don't have access to that.
A possible way is to develop that module with Flash or Silverlight, which gives you a higher level of permissions allowing interaction with the user's computer disk.

Apart from the problem I described above, you also have to consider the server-side load problem.
I don't know how big your movie files are but downloading them fully in one shot can be a network problem that only tends to increase as your users base increases.

Any solution you find for this, should consider the user explicitly requesting to have the offline versions of the movies. Making this automatic will result in a lot of wasted network capacity.

If you have a look at Pluralsight, for instance, they offer offline viewing but you need to download an app and you have a limited amount of offline slots.
This is a very good approach to prevent the users from dumping data from your site and most importantly, prevent them from killing your file server(s).
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
The system has been designed like many new system. The person who wrote it blithely assumed 100.0% internet connection. This is the result.

Author

Commented:
Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial