From 2e6676f50be3d66954442a5d22c2f41e74198a0e Mon Sep 17 00:00:00 2001 From: DylanSpeiser-BMD Date: Tue, 9 Jul 2024 09:55:57 -0700 Subject: [PATCH] v1.2c constructor --- BMDevice.js | 6 +++--- README.md | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/BMDevice.js b/BMDevice.js index ffaaac9..f4729d8 100644 --- a/BMDevice.js +++ b/BMDevice.js @@ -190,9 +190,9 @@ class BMDevice { // Child Class Specifically for Cameras class BMCamera extends BMDevice { // Child class constructor - // Just passing the hostname to the superclass's constructor - constructor(hostname) { - super(hostname); + // Just passing the hostname and security to the superclass's constructor + constructor(hostname, secure=false) { + super(hostname, secure); } // Sets the white balance and tint based on the following preset: diff --git a/README.md b/README.md index f7d7822..0c643ea 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,9 @@ For more information about using the BMD REST API and how I wrote `BMDevice.js`, ### Basic Use You are more than welcome to use this JavaScript class in your own projects. Just include the file (with its attributions). -Cameras are represented as BMCamera objects, instantiated with the `new` keyword and the constructor, which takes the hostname as a String argument. If you are using this file to control a HyperDeck, instantiate it as a `BMDevice` object. +Cameras are represented as BMCamera objects, instantiated with the `new` keyword and the constructor, which takes the hostname as a String argument. The constructor also (optionally) takes another boolean argument for whether or not to use HTTPS and WSS requests rather than their unsecre counterparts. In order to use the secure protocols, you must generate a certificate in **Blackmagic Camera Setup**. + +If you are using this file to control a HyperDeck, instantiate it as a `BMDevice` object. ### Updating the UI After instantiation, the constructor automatically subscribes to and pulls data from every available WebSocket property. If you don't like this, comment out lines 93-98 of `BMDevice.js`.