badfortrains / mediaWatcher

nodejs platinum module
3 stars 3 forks source link

Windows support #4

Open Karnith opened 9 years ago

Karnith commented 9 years ago

will there be any windows support?

badfortrains commented 9 years ago

Hey Karnith,

Theoretically a windows build should work, but I don't have a machine to test it on and confirm that. A little while back someone else(@pmed) forked and made a new binding.gyp that seems to support windows (https://github.com/saco-tech/mediaWatcher/commit/1b3592dcbb8964c4566dc912b425821d7141d69a). I went ahead and merged those changes back in with a number of other changes I made recently to make this work for node 0.12. If you want to give it a try, would definitely be interested in hearing back about successes/issues

Karnith commented 9 years ago

Sure, I'll try it. Thanks for the update. Does mediaWatcher utilize all of the Platinum api? I'm currently creating a home media streaming service and like the idea of using mediaWatcher for the upnp server and adding dlna with ffmpeg on-the-fly transcoding based off of device profiles.

badfortrains commented 9 years ago

Unfortunately I've only implemented a small subset of the platinum API, mostly the upnp media controller functions. Generally the functionality this exposes is pretty similar to what the "MicroMediaController" example program within Platinum allows. I'll try to update the readme soon to make this more clear for people browsing to this repo.

To implement a full upnp server you would need access to PLT_MediaServerDelegate, and PLT_MediaServer which I haven't exposed. The way mediaWatcher is organized is pretty coupled to the upnp controller functionality so adding in the server apis would probably force some fairly large changes Currently mediaWatcher exports an object constructor for what is essentially a upnp media controller. Adding the server piece would involve exporting a new constructor for a server, but also refactoring some of the upnp initialization code away from the media controller object. The actual code though should be pretty similar to what was needed for the media controller - mostly unwrapping and wrapping javascript values, and alerting the main thread when things need to be passed back to node (although that describes most node addons).

So TLDR: server pieces aren't there currently. If you're interested in adding them I can point you in what I think would be the right direction, but there might be other solutions out there that would be easier (not sure what the state of other upnp node addons is).

Also, for completeness here is a list of all the functionality currently implemented:

browse (uuid, directoryID (0 == top) -> list of items in that container) getTracks (same as browse but will give more metadata about items) getPosition setRenderer openTrack (== setAVTransportURI) openNextTrack (== setNextAVTransportURI) play stop pause next setVolume seek getRenderers

Events: media renderer added media renderer removed media server added media server removed

media server state variable changed media renderer state variable changed