As far as I know the other integrations are also loading meteor app through HTTP so they all will have this limitation.
I have checked --allow-file-access-from-file and it does not work in Electron. IMHO that would be a valid way, but seems that is out of the table.
Could you elaborate on it a little more? I do not quite understand how you are doing it right now.
We can work out a solution for you but I need to understand your needs better. You want to load images and videos from the local path and display them in the renderer process?
I can prepare a solution similar to the one used in the cordova integration - local file system is available there as a http alias, for example: /local-filesystem/my/local/path/and/file.mov.
But when it comes to efficiency I am not sure what would be faster - Iād bet on IPC. But when using IPC you will have trouble trying to actually show it.
readImageFile: function(url) {
console.log('read file from: ' + url);
var Future = Npm.require('fibers/future');
var myFuture = new Future();
fs.readFile(String(url), function read(error, result) {
if(error){
myFuture.throw(error);
}else{
myFuture.return(new Buffer(result).toString('base64'));
}
});
return myFuture.wait();
}
then I display the image, e.g:
<img [src]="imageData">
This is working ok but takes about half a second to load each image rather than the file protocol which loads almost instantly. Its also a bit harder to implement, and I havenāt even tried videos yetā¦
So yes I assume that would be rendering in electronās renderer process but iām not very familiar with electron yetā¦
It would be great if you could prepare a solution, and I trust whatever method you would suggest!
Lets start with exposing local file system over HTTP - https://github.com/wojtkowiak/meteor-desktop/issues/20
I will also prepare an example of pushing files over IPC, so you will be able to test and choose what will perform better in your scenario.
Wow, thank you very much. This is awesome. Now we can build mobile apps (Cordova/React Native), web apps and desktop apps with ease. I really love to work with Meteor
Finally, meteor desktop has arrived and I hope it will be part of the core or at least, be given its own rightful place in the official meteor guide. Thanks @omega for this awesome package/project! Shout out to MDG esp. @sashko! The community has been waiting for this for a long time and finally it is here!
Yep, this is really great. Weāve just released our Meteor app also as Windows + Mac app with meteor-desktop. Just a few code modifications for the desktop users and now we are able to reach more users. We are also able to extend our marketing mix (f.e. now we can advertise our app on download sites for programs).
Well, actually none of the current meteor/electron packages were fitting my needs. I needed an equivalent of cordova client with the same HCP mechanism built in. Also I wanted to keep the learning curve as low as possible so I would not bother my team with extra learning. I have started year ago with fork of electrify but it occurred to me quickly that I wanted a totally different architecture for this.
In the long term I still have in plans to replicate what electrify is doing, so there will be a plugin that will bundle your meteor server and mongodb - because I have heard there is some anticipation for that.
Havenāt considered that yet, but I will surely do if there is a need. Maybe after 1.0. In 0.3.0 or 0.4.0 I will add ability to scaffold some additional examples so there will be more to learn from.
Congratulations for the great work!
One quick (noob) question, please: is it possible to build a desktop app starting from an existing Meteor app, which exposes only desktop-dedicated GUIs and features?
I mean: I have a standard Meteor app and I need to add a desktop client to it, but this client needs to have a different GUI and different functions (but needs to share server-side data and logic). I was wondering if this package can be the right choice.
We did it with React, so in our case mobile version and desktop version have different routes and components (but most of the mobile components extend from the desktop components). You have a Meteor.isDesktop variable there to check if the user uses the desktop app, so it is possible :).