@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
115 lines (114 loc) • 5.04 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 BitmovinResponse_1 = require("../../../../../models/BitmovinResponse");
var IFramePlaylist_1 = require("../../../../../models/IFramePlaylist");
var PaginationResponse_1 = require("../../../../../models/PaginationResponse");
var IFramePlaylistListQueryParams_1 = require("./IFramePlaylistListQueryParams");
/**
* IframeApi - object-oriented interface
* @export
* @class IframeApi
* @extends {BaseAPI}
*/
var IframeApi = /** @class */ (function (_super) {
__extends(IframeApi, _super);
function IframeApi(configuration) {
return _super.call(this, configuration) || this;
}
/**
* @summary Add I-frame playlist to variant stream
* @param {string} manifestId Id of the hls manifest.
* @param {string} streamId Id of the variant stream.
* @param {IFramePlaylist} iFramePlaylist The I-frame playlist to be added
* @throws {BitmovinError}
* @memberof IframeApi
*/
IframeApi.prototype.create = function (manifestId, streamId, iFramePlaylist) {
var pathParamMap = {
manifest_id: manifestId,
stream_id: streamId
};
return this.restClient.post('/encoding/manifests/hls/{manifest_id}/streams/{stream_id}/iframe', pathParamMap, iFramePlaylist).then(function (response) {
return (0, Mapper_1.map)(response, IFramePlaylist_1.default);
});
};
/**
* @summary Delete I-frame playlist
* @param {string} manifestId Id of the hls manifest.
* @param {string} streamId Id of the variant stream.
* @param {string} iframeId Id of the Iframe-Playlist.
* @throws {BitmovinError}
* @memberof IframeApi
*/
IframeApi.prototype.delete = function (manifestId, streamId, iframeId) {
var pathParamMap = {
manifest_id: manifestId,
stream_id: streamId,
iframe_id: iframeId
};
return this.restClient.delete('/encoding/manifests/hls/{manifest_id}/streams/{stream_id}/iframe/{iframe_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary I-frame playlist Details
* @param {string} manifestId Id of the hls manifest.
* @param {string} streamId Id of the variant stream.
* @param {string} iframeId Id of the Iframe-Playlist.
* @throws {BitmovinError}
* @memberof IframeApi
*/
IframeApi.prototype.get = function (manifestId, streamId, iframeId) {
var pathParamMap = {
manifest_id: manifestId,
stream_id: streamId,
iframe_id: iframeId
};
return this.restClient.get('/encoding/manifests/hls/{manifest_id}/streams/{stream_id}/iframe/{iframe_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, IFramePlaylist_1.default);
});
};
/**
* @summary List all I-frame playlists of a variant stream
* @param {string} manifestId Id of the hls manifest.
* @param {string} streamId Id of the variant stream.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof IframeApi
*/
IframeApi.prototype.list = function (manifestId, streamId, queryParameters) {
var pathParamMap = {
manifest_id: manifestId,
stream_id: streamId
};
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new IFramePlaylistListQueryParams_1.IFramePlaylistListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/manifests/hls/{manifest_id}/streams/{stream_id}/iframe', pathParamMap, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, IFramePlaylist_1.default);
});
};
return IframeApi;
}(BaseAPI_1.BaseAPI));
exports.default = IframeApi;