Bugfixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WirecastConnection = void 0;
|
||||
var axios_1 = require("axios");
|
||||
var WirecastConnection = /** @class */ (function () {
|
||||
@@ -56,14 +56,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.ping = function (callback) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/ping")
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/ping"))
|
||||
.then(function () {
|
||||
if (callback)
|
||||
callback(true);
|
||||
if (callback == undefined)
|
||||
resolve();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
if (callback)
|
||||
callback(false);
|
||||
if (callback == undefined)
|
||||
@@ -74,14 +75,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.setShotLiveByID = function (shotID) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/shots/liveByID/" + shotID)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/shots/liveByID/").concat(shotID))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject();
|
||||
});
|
||||
@@ -90,14 +92,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.clearShotIfLive = function (shotID) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/shots/clearIfLive/" + shotID)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/shots/clearIfLive/").concat(shotID))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject();
|
||||
});
|
||||
@@ -106,14 +109,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.clearLayer = function (layerID) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/layers/clear/" + layerID)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/layers/clear/").concat(layerID))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject();
|
||||
});
|
||||
@@ -122,15 +126,16 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.go = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
console.log("http://" + _this.ip + ":" + _this.port + "/api/v2/document/go");
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/document/go")
|
||||
console.log("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/go"));
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/go"))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject();
|
||||
});
|
||||
@@ -139,15 +144,16 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.multiShot = function (layer1Shot, layer2Shot, layer3Shot, layer4Shot, layer5Shot) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this
|
||||
.port + "/api/v2/shots/multi/" + layer1Shot + "/" + layer2Shot + "/" + layer3Shot + "/" + layer4Shot + "/" + layer5Shot)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this
|
||||
.port, "/api/v2/shots/multi/").concat(layer1Shot, "/").concat(layer2Shot, "/").concat(layer3Shot, "/").concat(layer4Shot, "/").concat(layer5Shot))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve(response.data);
|
||||
else
|
||||
reject(response.data);
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject({ succeed: false, error: 'Unable to reach Wirecast-Bridge' });
|
||||
});
|
||||
@@ -156,14 +162,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.setBroadcasting = function (state) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/document/broadcasting/" + state)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/broadcasting/").concat(state))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject('Unable to reach Wirecast-Bridge');
|
||||
});
|
||||
@@ -172,14 +179,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.setRecording = function (state) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/document/recording/" + state)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/recording/").concat(state))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject('Unable to reach Wirecast-Bridge');
|
||||
});
|
||||
@@ -188,14 +196,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.setAutoLive = function (state) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/document/autolive/" + state)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/autolive/").concat(state))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject('Unable to reach Wirecast-Bridge');
|
||||
});
|
||||
@@ -204,14 +213,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.setTransitionSpeed = function (speed) {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios_1["default"]
|
||||
.get("http://" + _this.ip + ":" + _this.port + "/api/v2/document/transitionspeed/" + speed)
|
||||
axios_1.default
|
||||
.get("http://".concat(_this.ip, ":").concat(_this.port, "/api/v2/document/transitionspeed/").concat(speed))
|
||||
.then(function (response) {
|
||||
if (response.data.succeed == true)
|
||||
resolve();
|
||||
else
|
||||
reject();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
reject('Unable to reach Wirecast-Bridge');
|
||||
});
|
||||
@@ -220,14 +230,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
WirecastConnection.prototype.getShots = function (callback) {
|
||||
var _this = this;
|
||||
if (this.ip != undefined && this.port != undefined) {
|
||||
axios_1["default"]
|
||||
.get("http://" + this.ip + ":" + this.port + "/api/v2/shots/get")
|
||||
axios_1.default
|
||||
.get("http://".concat(this.ip, ":").concat(this.port, "/api/v2/shots/get"))
|
||||
.then(function (response) {
|
||||
if (response.data != undefined && response.data.succeed == true) {
|
||||
_this.shots = response.data.shots;
|
||||
callback(_this.shots);
|
||||
}
|
||||
})["catch"](function () { });
|
||||
})
|
||||
.catch(function () { });
|
||||
}
|
||||
};
|
||||
WirecastConnection.prototype.getShotsList = function (layerIndex, callback) {
|
||||
@@ -250,14 +261,15 @@ var WirecastConnection = /** @class */ (function () {
|
||||
};
|
||||
WirecastConnection.prototype.getLayers = function (callback) {
|
||||
var _this = this;
|
||||
axios_1["default"]
|
||||
.get("http://" + this.ip + ":" + this.port + "/api/v2/layers/get")
|
||||
axios_1.default
|
||||
.get("http://".concat(this.ip, ":").concat(this.port, "/api/v2/layers/get"))
|
||||
.then(function (response) {
|
||||
if (response.data != undefined && response.data.succeed == true) {
|
||||
_this.layers = response.data.layers;
|
||||
callback(_this.layers);
|
||||
}
|
||||
})["catch"](function () { });
|
||||
})
|
||||
.catch(function () { });
|
||||
};
|
||||
WirecastConnection.prototype.getLayersList = function (callback) {
|
||||
var _this = this;
|
||||
|
||||
Reference in New Issue
Block a user