GoPro JS
A Promise based JavaScript GoPro Controller/API Wrapper (Unofficial)
The Idea:
While checking for JavaScript solutions to control my GoPro I found out that the existing ones were too specific to one single model or even written in other languages.
Using ES6 I'm aiming to create a Proxy for different API's in a way that you only need to create an instance of the object and it will discover itself and use the proper API to communicate with the camera.
The API's will implement an interface, making it modularized and easy to mantain and extend. With this approach I'm hoping to be compatible with every model since it can hold different ways to interact with different models.
Initially I will focus on the HERO4 model since is the one I own. But I'm referencing my work on these open-source projects that explore and reverse engineer other models, making it more easy to implement them:
Installation
npm install gopro-js
Usage:
This package is Promise based, with a simplified chain workflow without the explicit then
usage.
Attention when using then or catch: The value returned is a new GoPro instance, with the last promise result attached to lastResult property!
const gp = // Instantiategp // Begin chaining (without then) // Delays the next method // Records 2s video after 0s delay status'Storage.RemainingPhotos' // Calls and unexistent method, throwing an error // Apply some setting status'System.BUSY' // Check camera status // Print previous result // Activate shutter after 2 seconds delay // Apply some setting // Deletes the last 2 files // Power Off // Power On
const gp = mac: 'AA:BB:CC:DD:EE:FF' // Instantiate with a valid mac addressgp // It can discover itself and powerOn const gp2 = // Or without mac(but already turned on) it can powerOn after a powerOffgp2