Steam In-Home Streaming, PS4 Remote Play, NVIDIA GameStream, and Xbox One game streaming all require unique software and/or hardware in client devices. Moonlight aims to bring game streaming to everyone with a suite of open-source game streaming clients compatible with NVIDIA GameStream.
What it does
How we built it
Moonlight for Chrome was built using Chrome's Native Client (NaCl) plugin system. It consists of C/C++ code compiled to a machine-independent bytecode which is distributed on the Chrome Web Store. We took the core streaming library for Moonlight clients and made the required changes for it to build and run under Native Client. This includes interfacing with the system's hardware decoding capabilities via NaCl and OpenGL, integrating the libopus library for audio decoding, tying in the various input and gamepad events from Chrome, and building a UI around it all.
Challenges we ran into
The sample code for doing hardware accelerated video decoding and rendering left us with several showstopping OpenGL bugs that took over 8 hours to track down. The lack of widespread use of NaCl meant that there were few external resources to help us.
Accomplishments that we're proud of
We finally brought game streaming to ChromeOS users and allowed users to take their game streaming software on the go in a way only a browser-based solution can.
What we learned
Neither of us were web programmers prior to this, so integrating with the browser has been a very new experience. In addition, the OpenGL work was also new and unfamiliar territory. While it was tough to debug, I'm happy with how it turned out.
What's next for Moonlight for Chrome
We plan to launch the app on the Chrome Web Store in the coming weeks (after a bit of polish).