Due to a bug that keeps crashing chrome tabs () it is not possible to download large files (>50-80 Mb) via an ajax request.
Unfortunately I have to use Chrome as it is the only browser that currently implements the FileSystem API (/).
How would I download a large movie file to display it in a <video>
?
Do you have some code samples?
Due to a bug that keeps crashing chrome tabs (http://code.google./p/chromium/issues/detail?id=138506) it is not possible to download large files (>50-80 Mb) via an ajax request.
Unfortunately I have to use Chrome as it is the only browser that currently implements the FileSystem API (http://www.w3/TR/file-system-api/).
How would I download a large movie file to display it in a <video>
?
Do you have some code samples?
Share Improve this question edited Nov 21, 2014 at 11:48 kurast 1,6153 gold badges17 silver badges41 bronze badges asked Feb 7, 2013 at 9:12 Jo DavidJo David 1,7462 gold badges18 silver badges20 bronze badges 4- 1 Why don't you let the browser do that? Insert the <video> tag HTML into a container of the page (innerHTML property). No need to ask Javascript to do what the browser does automatically. I don't understand why so many people insist on reprogramming part of the webbrowser in Javascript to run IN A webbrowser :) – Mörre Commented Feb 7, 2013 at 9:19
-
Am I able to access the video as blob to save it in the FileSystem. So this is somehow similar to the way I save images (
new Image ... img.src = ""
). – Jo David Commented Feb 7, 2013 at 9:32 - No. If you insist on saving the file WITHOUT user action - because with user action you can again let any browser do a regular file download, if the webserver send the correct mime-type (to cause the "Save As" dialog instead of the browser trying to display the file) - and if the browsers that would allow this have a bug than that's it - does not work. If you insist on testing beta features/code... :) – Mörre Commented Feb 7, 2013 at 9:35
- Yeah, I need to do it programatically. – Jo David Commented Feb 7, 2013 at 10:01
2 Answers
Reset to default 1I've managed to code a working implementation of a javascript chunkloader. It relies on some server side code that returns a chunk count and the chunks itself. The client side code works quite well.
If you want to take a look or have any improvements feel free to fork, copy or share it: https://github./bux578/chunkload.js
According to the issue you've linked to, this is a memory limit being reached - which you may well get in any browser with limited memory.
The issue in Chrome is that the XHR doesn't throw an exception, so the error can't be caught and worked around - so it would appear that there is no fix available short of possibly increasing the memory available.
The File API is available with full support in Firefox, Chrome, Safari and Opera and partial support in IE10:
http://caniuse./fileapi