diff --git a/BMDevice.js b/BMDevice.js index f1777b5..e83b415 100644 --- a/BMDevice.js +++ b/BMDevice.js @@ -22,6 +22,9 @@ class BMDevice { hostname; APIAddress; + // Are we using HTTPS? + useHTTPS; + // WebSocket items ws; availableProperties; @@ -39,10 +42,13 @@ class BMDevice { updateUI() {}; // ============= CONSTRUCTOR ================ - constructor(hostname) { + constructor(hostname, secure=false) { + // Set Security + this.useHTTPS = secure; + // Set name properties this.hostname = hostname; - this.APIAddress = "http://"+hostname+"/control/api/v1"; + this.APIAddress = (this.useHTTPS ? "https://" : "http://")+hostname+"/control/api/v1"; this.name = this.hostname.replace(".local","").replaceAll("-"," "); // Initialize WebSocket diff --git a/README.md b/README.md index cdccb9d..f7d7822 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ If your camera does not have an ethernet port, use a USB-C to ethernet adapter. ![BM Camera Setup](screenshots/BMCameraSetup2.png) +> If you're using the GitHub Pages site, the API must be accessed with HTTPS rather than HTTP. You can enable this on the camera in **Blackmagic Camera Setup** by clicking the "Generate Certificate" button. + ## Launching the App The app is a self-contained, offline web page. (No installation, dependencies, or servers to worry about!) Simply open the `index.html` file in your browser of choice, enter the hostname of your camera, and press "Connect". diff --git a/index.html b/index.html index ae5a99f..97f5568 100644 --- a/index.html +++ b/index.html @@ -196,6 +196,8 @@ + + Use HTTPS @@ -331,7 +333,7 @@
- (v 1.1) + (v 1.2)