v1.2c
constructor
This commit is contained in:
parent
3c1c8aaed5
commit
2e6676f50b
2 changed files with 6 additions and 4 deletions
|
|
@ -190,9 +190,9 @@ class BMDevice {
|
||||||
// Child Class Specifically for Cameras
|
// Child Class Specifically for Cameras
|
||||||
class BMCamera extends BMDevice {
|
class BMCamera extends BMDevice {
|
||||||
// Child class constructor
|
// Child class constructor
|
||||||
// Just passing the hostname to the superclass's constructor
|
// Just passing the hostname and security to the superclass's constructor
|
||||||
constructor(hostname) {
|
constructor(hostname, secure=false) {
|
||||||
super(hostname);
|
super(hostname, secure);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the white balance and tint based on the following preset:
|
// Sets the white balance and tint based on the following preset:
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,9 @@ For more information about using the BMD REST API and how I wrote `BMDevice.js`,
|
||||||
### Basic Use
|
### Basic Use
|
||||||
You are more than welcome to use this JavaScript class in your own projects. Just include the file (with its attributions).
|
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
|
### 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`.
|
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`.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue