URL for local mp4

I am working on creating a WEB Core / Miletus app. The app will be downloading mp4 files. The mp4 files will be stored locally so the app can play them "offline".

The app uses the TWebMultimediaPlayer component. The mp4 file is stored in a video folder under the root folder (the folder where the .exe is stored). When the javascript app tries to load the file via the URL property ( URL := "video/videoName.mp4", the browser console reports a 404 error. Should this work?
If not, is there a way that this can be done?


Both in WEB Core and Miletus you are working on a web application that is hosted by a browser in one way or another. The browser can not (and should not) access files on your system on its own, that would be a huge security risk.

With TWebMultimediaPlayer normally you can use a base64 data url. In Miletus we've provided access to local files via the TMiletusBinaryDataStream class, which gives you an option to get a file in base64 format.

Putting the two together:

procedure TForm1.WebButton1Click(Sender: TObject);
  bs: TMiletusBinaryDataStream;
  bs := TMiletusBinaryDataStream.Create;
  bs.LoadFromFileAsync(YOUR_PATH, procedure
    //Assign the base64 in the form of a base64 data url by 
    //adding the necessary
    WebMultimediaPlayer1.URL := 'data:video/mp4;base64,' + bs.Base64;

Thank you

I downloaded and installed TMS Web Core version 2.5.3.

The TMiletusStringList appears to be working correctly on a RaspberryPi.

However, I see no difference in the behavior of the TMiletusFileWatcher.
if the file exists and changes are made the oncChange event does not occur.
if the file that is being watched is removed an exception is reported "Invalid argument to date encoding".

Am I missing something.

below is the code I use to setup the FileWatcher.

--Rick Howitt

_fileWatch := MiletusFileWatcher2.Files.Add;
_fileWatch.FileName := APlaybackJSONclass.JSON_PAFN;
_fileWatch.onChange := MiletusFileWatcher1Files0Change;

_fileWatch := MiletusFileWatcher2.Files.Add;
_fileWatch.FileName := AScreenConfigJSONclass.JSON_PAFN;
_fileWatch.onChange := MiletusFileWatcher1Files1Change;