How to view big h5p files - html

As I understand, h5p cannot be viewed on a local device, e.g. in offline mode (I'm aware of h5p-standalone but it requires setting up a local webserver)
and viewing requires a webserver that supports h5p, e.g. via WordPress plugin.
Assuming that I have a large h5p file (e.g. 1G Byte) with many images.
Does this large file needs to be uploaded first to the server?
Thanks

If you want to run H5P files, you will always have to have some form of runtime environment. That can be (PHP) based like the ones that you already mentioned, but there's also a node.js port of H5P core than can be used. That port is also the foundation of the editor/player named Lumi. It uses Electron to edit/play H5P files locally on Windows, MacOS and Linux. So the H5P file will not have to be provided on a webserver to run.
You can also use Lumi (or its functions) to convert H5P files into single HTML files that contain all the code and the stylesheets to run, also media (base64 encoded). Of course, that approach tends to generate large files and you have a lot of redundancy as all dependecies that are required to rum will be inside every single HTML file instead of being loaded as needed - but you can run that file in a browser either from a server or locally without the need for a webserver.

Related

Windows store app update

Is windows store(windows 10) allow only delta update or we can update in some other way?If we have an app in windows store(windows 10) and I downloaded it in my machine.After some time update is available for that app and i have updated the app.Now, I want to verify weather it follow delta update or it replaces the entire application with the new one. How can i verify it?
Is windows store(windows 10) allow only delta update or we can update
in some other way?
You can select Generate app bundle always or if needed when creating app packages to implement delta update. App bundle uses a different manifest to contain the resources packages. Thus with app bundle, users only download the relevant files, rather than all possible resources, especially when your app includes language-specific assets.
To make users download the whole package, you can choose Generate app bundle never. But please note once your app is published as appxbundle, you cannot go back to non-appxbundle format. This time you can try method in this article to ensure your resources will surely be installed on the users' devices, which is for Windows 8.1 but still works to UWP app.
And since the version 1607, we can use the API in Windows.Services.Store to programmatically check for package updates for the current app, download and installed the updated packages.
Now, I want to verify weather it follow delta update or it replaces
the entire application with the new one. How can i verify it?
Firstly, your package need to contain the language-specific assets or a variety of image-scale assets, making sure to include the language not supported by your device or image-scale not equipped with your device. You need to generate an app bundle while creating package. After downloading the update, you can check if your local package contains the resource package not needed.
Apart from choosing the right languages, image sizes from the App Bundle as mentioned by Mattew Wu, UWP supports delta updates (or differential updates) automatically. Check out more in this blog post in MSDN blogs.
A "AppxBlockMap.xml" is automatically created at the time of packaging, which is
an XML document that contains a two dimensional list of information about files in the package. The first dimension lays out high level details on the file (e.g. name and size) and the second dimension provides SHA2-256 hash representations of each 64KB slice of that file (aka the “block”).
So, the Store update compares this file from both the packages and downloads only the required parts.
I don't think you will be able to check the size of the delta package that will be downloaded, but there are a few methods that you can follow to make sure that your app supports delta updates
Keep files in the package small – doing this will ensure that if a change is needed that would impact the full file, the update would still be small.
Modifications to files should be additive if possible – additive changes will ensure that end-user devices only download those changed blocks.
Modifications to files should be contained to 64KB blocks if possible – if your app does have large files and requires changes to the middle of a file, containing changes to a set of blocks will go a long way
Refer the aforementioned blog post for more detailed explanation.

Using a web browser read system time, display data and write configuration data from a USB Mass storage class

I've an embedded system which runs firmware and has USB mass storage with size 79kB. So when you plug in the device to any computer(MAC/Windows), it pops as a 79kB flash drive. The firmware creates files which has transaction records. The objective is to display these transactions (tables and simple graphs) to the user. I've narrowed down to a web browser. So the user (with MAC/Windows PC) can plug in the USB device mass storage and open an HTML file in the mass storage drive and view all the transactions in the form of tables and simple bar graphs. The tricky part comes here: the device(firmware) needs to update it's clock, and this time input has to be sourced from the MAC/Windows PC. How can this be achieved?
This is the minimum requirement. Further, through the web browser the user wants to write some configuration parameters for e.g. through a text box and a submit button in the HTML page.
NOTE: Here the device has USB mass storage type and the web browser approach were selected so that there is no prerequisites for the user.
Please suggest an alternative if this can be done using another approach for e.g. a different class of USB or some other application locally available on MAC/Windows desktop/laptop. For e.g. the application should run on both on Mac and Windows i.e. the code should be the same but can be built into separate packages one for Mac and the other (.exe) for Windows. Please suggest a platform for this that has same source but can be built for both mac and windows. Thanks!
As far as I know, there is no way a web browser could write to a file. If such a thing was possible, it would be a huge security issue.
You have to write a piece of native software to do all the tasks you name. That can be done in pretty much any programming language, and if you're developing embedded systems I reckon you must have some experience in programming.
I'm looking at doing something similar and have an idea, though you may be better equipped to run with it than I am. Have the define contain a directory called "SET_DATE" with files "YEAR15" through "YEAR99", "MON01" through "MON12", "DATE01" through "DATE31", "H00" through "H23", "M00" through "M59", "S00" through "S59", and "SET"; each such file should start at a different sector, though none of the sectors in question need to contain any data (they need not physically be stored anywhere). To set the date to July 4, 2020 at 12:34:56pm, read the following files in sequence:
SET_DATE/YEAR20
SET_DATE/MONTH07
SET_DATE/DATE04
SET_DATE/H12
SET_DATE/M34
SET_DATE/S56
SET_DATE/SET
The last access should cause the unit to set its clock. If a user might want to set the clock more than once, that could be accommodated by either having a bunch of essentially-identical directories under SET_DATE (so setting the date the first time would use SET_DATE/00/YEAR20, the second time SET_DATE/01/YEAR20, etc.) and/or having the drive unmount/remount itself if necessary to clear out any caching.
I would think it unwise to have directory fetches trigger actions, since Windows or an anti-virus tool might decide to pre-cache all the directories in a drive when it is mounted. I would not expect Windows or a browser to eagerly load files, however, so I would think one could have read accesses trigger actions.

file:/// for url path for local html files?

I'm just started web developing not long ago, and I'm wondering why running HTML on my computer comes up with file:/// and then the file path and name in the browser url bar. For example, what I'm testing right now is:
file:///D:/WebDesign/HTML/test/default.html
Why isn't it file://, or just the pathname?
Is there a certain reason for this?
thanks for any answers.
// is part of the general format of URI schemes.
The next / comes after the optional — if defaults to localhost — hostname (since you can have a network path for file URIs).
See the Wikipedia article for more details.
It is a standard URL code for a local file. Also Check out this:-
the slash is a general, system-independent way of separating the
parts, and in a particular host system it might be used as such in a
pathname (as in Unix systems) or internally mapped to another
character
That is just standard URL code for a local file. A similar syntax is used to refer to a file on a network drive.
However, if you are attempting to develop like that you will run into problems, especially if you intend to test server-side functionality in languages like PHP. You may wish to look into installing a (free) program such as XAMPP or WAMP/MAMP that will emulate an apache server and allow you to test these things.
You can find some very helpful (free) tutorial videos here
Look at the first three videos here
And here's another that discusses installing XAMPP/WAMP

Moving content form local storage to OS file system

I’m looking to implement Drag and Drop solution, than store the web page content and assets in the local storage using filesystem API.
My problem is that I need to move the files I’ve stored in the local storage to OS file system.
Would be interesting to hear few implementation for this.
Thanks!
HTML5 has a File System API included that allows you to read, write and create files in a secured virtual file system that are also domain-specific (no file crossing with other domains).
If you are just trying to store contents and assets for offline viewing, you can just whip up a Manifest Cache. I see no need for local storage, or drag and drop, or File System API, because these are very different tools for very different needs. Anyway, if you would still like to use File System API, check out this page from MDN.
Angela

Huge file upload

I have a web service that accepts really huge files. Usually in the range of 10 - 15 GB (not MB).
However upload using a browser is only possible using Chrome on Linux. All 3 major browsers have different flaws trying to upload such a file:
Internet Explorer stops after exactly 4GB.
Firefox does not start at all.
Chrome (on Windows) transfers the whole file but fails to send the closing bondary (send 0xff instead).
Now we are searching for a way to get uploads to work. Preferably using HTML/JS only, but I see no way to make that happen. Second try would be flash, but FileReference seems to break for files > 4GB. Last way would be Java but that is not what we are looking for in the browser client.
Note that this is about the client. I know that the server side code works, as I can upload a 12GB file using standard HTML-Upload with Chrome on Linux. It is the only browser/os combination that works so far, but therefor I am sure, the server coode is fine.
Does anyone know any way to get huge file uploads to work?
Regards,
Steffen
There is a fairly young JS/HTML5 API which might cover your user case:
https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications
I can't speak to its suitability though.
If you're using IIS, the default max file upload is 4GB. You need to change this in your script or your server settings.
See: Increasing Max Upload File Size on IIS7/Win7 Pro
Normally you would break and upload such files in chunks using stream upload. If you take a limited amount data of the file, upload that part to the server, server appends data to the file. Repeat till complete file is uploaded. You can read a file in parts using FileStream (update: Adobe AIR only) or with javascript using the experimental Blob/FileReader. I guess this could be a workaround for the problem.
I think this solution could help:
AS3 fileStream appears to read the file into memory
Let me know if this works out, its an interesting problem.