UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

98 lines (97 loc) 4.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../../../common/BaseAPI"); const Mapper_1 = require("../../../../../common/Mapper"); const BitmovinResponse_1 = require("../../../../../models/BitmovinResponse"); const IFramePlaylist_1 = require("../../../../../models/IFramePlaylist"); const PaginationResponse_1 = require("../../../../../models/PaginationResponse"); const IFramePlaylistListQueryParams_1 = require("./IFramePlaylistListQueryParams"); /** * IframeApi - object-oriented interface * @export * @class IframeApi * @extends {BaseAPI} */ class IframeApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); } /** * @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 */ create(manifestId, streamId, iFramePlaylist) { const pathParamMap = { manifest_id: manifestId, stream_id: streamId }; return this.restClient.post('/encoding/manifests/hls/{manifest_id}/streams/{stream_id}/iframe', pathParamMap, iFramePlaylist).then((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 */ delete(manifestId, streamId, iframeId) { const 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((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 */ get(manifestId, streamId, iframeId) { const 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((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 */ list(manifestId, streamId, queryParameters) { const pathParamMap = { manifest_id: manifestId, stream_id: streamId }; let 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((response) => { return new PaginationResponse_1.default(response, IFramePlaylist_1.default); }); } } exports.default = IframeApi;