paneron/extension-smart

Support video

Opened this issue · 9 comments

Support video

@strogonoff video files like mov files are read as text data in Paneron now. I think it is related to the default file handling mechanism in Paneron as video files are not recognized. Anyway, binary data from the video files are needed.

@wkwong-ribose Default handler for unrecognized files is plain text, and there is no handler for video formats. I can add a binary handler for video file extensions, but generally fetching and writing their data may be super slow (that’s why there is no handler). Maybe we should rethink the approach to video.

@strogonoff video is a feature we must have available as discussed yesterday with the stakeholders. We are under time pressure for these features. Given that browser technologies handle video fine there must be a reasonable solution?

The file:// method can display a video on my computer.

So, this is the flow of how to set a video to play?

  1. A user select a file from his local computer.
  2. The file is copied to the repository.
  3. Play a movie with reference to the file in the repo

The requested API would be
fromFileSystemToRepo: async (savePath:string, maybe some other options) => some action result
Prompt the user to select a file, save to the given path in the repository.
The file data does not need to go through the extension then.

The binary content of the video may still be needed in the extension if we want to bundle everything into one single file (in the export model function).

This is something that we've thought of doing for a long time. We need a standard container that contains text, models and binaries. This is just like how OpenOffice and MS Office does it, e.g.

https://en.wikipedia.org/wiki/OpenDocument

The original OpenDocument format consists of an XML document that has as its root element. OpenDocument files can also take the format of a ZIP compressed archive containing a number of files and directories; these can contain binary content and benefit from ZIP's lossless compression to reduce file size. OpenDocument benefits from separation of concerns by separating the content, styles, metadata, and application settings into four separate XML files.

Right now Metanorma only uses a single XML file as a deliverable but we need a compressed archive format for realistic handling (e.g. if we want to bundle an HTML site with models).

I have seen and tried that function before.

I think the need here is a method to bring a video file into the dataset (or repo), as the extension cannot interact with the file system directly