@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
117 lines (116 loc) • 5.01 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var BaseAPI_1 = require("../../../common/BaseAPI");
var Mapper_1 = require("../../../common/Mapper");
var ResetLiveManifestTimeshiftApi_1 = require("./resetLiveManifestTimeshift/ResetLiveManifestTimeshiftApi");
var HdApi_1 = require("./hd/HdApi");
var InsertableContentApi_1 = require("./insertableContent/InsertableContentApi");
var Scte35CueApi_1 = require("./scte35Cue/Scte35CueApi");
var BitmovinResponse_1 = require("../../../models/BitmovinResponse");
var LiveEncoding_1 = require("../../../models/LiveEncoding");
var StartLiveEncodingRequest_1 = require("../../../models/StartLiveEncodingRequest");
/**
* LiveApi - object-oriented interface
* @export
* @class LiveApi
* @extends {BaseAPI}
*/
var LiveApi = /** @class */ (function (_super) {
__extends(LiveApi, _super);
function LiveApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.resetLiveManifestTimeshift = new ResetLiveManifestTimeshiftApi_1.default(configuration);
_this.hd = new HdApi_1.default(configuration);
_this.insertableContent = new InsertableContentApi_1.default(configuration);
_this.scte35Cue = new Scte35CueApi_1.default(configuration);
return _this;
}
/**
* @summary Live Encoding Details
* @param {string} encodingId Id of the encoding.
* @throws {BitmovinError}
* @memberof LiveApi
*/
LiveApi.prototype.get = function (encodingId) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/live', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, LiveEncoding_1.default);
});
};
/**
* @summary Live Encoding Start Details
* @param {string} encodingId Id of the encoding
* @throws {BitmovinError}
* @memberof LiveApi
*/
LiveApi.prototype.getStartRequest = function (encodingId) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/live/start', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, StartLiveEncodingRequest_1.default);
});
};
/**
* @summary Re-Start Live Encoding
* @param {string} encodingId Id of the encoding. **Important:** Only live encodings with the status `RUNNING`, `FINISHED`, `CANCELED` or `ERROR` can be restarted.
* @throws {BitmovinError}
* @memberof LiveApi
*/
LiveApi.prototype.restart = function (encodingId) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/live/restart', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Start Live Encoding
* @param {string} encodingId Id of the encoding
* @param {StartLiveEncodingRequest} startLiveEncodingRequest Live Encoding startup options
* @throws {BitmovinError}
* @memberof LiveApi
*/
LiveApi.prototype.start = function (encodingId, startLiveEncodingRequest) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/live/start', pathParamMap, startLiveEncodingRequest).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Stop Live Encoding
* @param {string} encodingId Id of the encoding
* @throws {BitmovinError}
* @memberof LiveApi
*/
LiveApi.prototype.stop = function (encodingId) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/live/stop', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
return LiveApi;
}(BaseAPI_1.BaseAPI));
exports.default = LiveApi;