3059 lines
161 KiB
TypeScript
3059 lines
161 KiB
TypeScript
|
/**
|
||
|
* Jellyfin API
|
||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||
|
*
|
||
|
* The version of the OpenAPI document: 10.8.9
|
||
|
*
|
||
|
*
|
||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||
|
* https://openapi-generator.tech
|
||
|
* Do not edit the class manually.
|
||
|
*/
|
||
|
|
||
|
|
||
|
import localVarRequest from 'request';
|
||
|
import http from 'http';
|
||
|
|
||
|
/* tslint:disable:no-unused-locals */
|
||
|
import { EncodingContext } from '../model/encodingContext';
|
||
|
import { SubtitleDeliveryMethod } from '../model/subtitleDeliveryMethod';
|
||
|
|
||
|
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
||
|
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
||
|
|
||
|
import { HttpError, RequestFile } from './apis';
|
||
|
|
||
|
let defaultBasePath = 'http://localhost';
|
||
|
|
||
|
// ===============================================
|
||
|
// This file is autogenerated - Please do not edit
|
||
|
// ===============================================
|
||
|
|
||
|
export enum DynamicHlsApiApiKeys {
|
||
|
CustomAuthentication,
|
||
|
}
|
||
|
|
||
|
export class DynamicHlsApi {
|
||
|
protected _basePath = defaultBasePath;
|
||
|
protected _defaultHeaders : any = {};
|
||
|
protected _useQuerystring : boolean = false;
|
||
|
|
||
|
protected authentications = {
|
||
|
'default': <Authentication>new VoidAuth(),
|
||
|
'CustomAuthentication': new ApiKeyAuth('header', 'Authorization'),
|
||
|
}
|
||
|
|
||
|
protected interceptors: Interceptor[] = [];
|
||
|
|
||
|
constructor(basePath?: string);
|
||
|
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||
|
if (password) {
|
||
|
if (basePath) {
|
||
|
this.basePath = basePath;
|
||
|
}
|
||
|
} else {
|
||
|
if (basePathOrUsername) {
|
||
|
this.basePath = basePathOrUsername
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
set useQuerystring(value: boolean) {
|
||
|
this._useQuerystring = value;
|
||
|
}
|
||
|
|
||
|
set basePath(basePath: string) {
|
||
|
this._basePath = basePath;
|
||
|
}
|
||
|
|
||
|
set defaultHeaders(defaultHeaders: any) {
|
||
|
this._defaultHeaders = defaultHeaders;
|
||
|
}
|
||
|
|
||
|
get defaultHeaders() {
|
||
|
return this._defaultHeaders;
|
||
|
}
|
||
|
|
||
|
get basePath() {
|
||
|
return this._basePath;
|
||
|
}
|
||
|
|
||
|
public setDefaultAuthentication(auth: Authentication) {
|
||
|
this.authentications.default = auth;
|
||
|
}
|
||
|
|
||
|
public setApiKey(key: DynamicHlsApiApiKeys, value: string) {
|
||
|
(this.authentications as any)[DynamicHlsApiApiKeys[key]].apiKey = value;
|
||
|
}
|
||
|
|
||
|
public addInterceptor(interceptor: Interceptor) {
|
||
|
this.interceptors.push(interceptor);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a video stream using HTTP live streaming.
|
||
|
* @param itemId The item id.
|
||
|
* @param playlistId The playlist id.
|
||
|
* @param segmentId The segment id.
|
||
|
* @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.
|
||
|
* @param runtimeTicks The position of the requested segment in ticks.
|
||
|
* @param actualSegmentLengthTicks The length of the requested segment in ticks.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param maxStreamingBitrate Optional. The maximum streaming bitrate.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vpx, wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
*/
|
||
|
public async getHlsAudioSegment (itemId: string, playlistId: string, segmentId: number, container: string, runtimeTicks: number, actualSegmentLengthTicks: number, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, mediaSourceId?: string, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, maxStreamingBitrate?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
|
||
|
.replace('{' + 'playlistId' + '}', encodeURIComponent(String(playlistId)))
|
||
|
.replace('{' + 'segmentId' + '}', encodeURIComponent(String(segmentId)))
|
||
|
.replace('{' + 'container' + '}', encodeURIComponent(String(container)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['audio/*'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'playlistId' is not null or undefined
|
||
|
if (playlistId === null || playlistId === undefined) {
|
||
|
throw new Error('Required parameter playlistId was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'segmentId' is not null or undefined
|
||
|
if (segmentId === null || segmentId === undefined) {
|
||
|
throw new Error('Required parameter segmentId was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'container' is not null or undefined
|
||
|
if (container === null || container === undefined) {
|
||
|
throw new Error('Required parameter container was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'runtimeTicks' is not null or undefined
|
||
|
if (runtimeTicks === null || runtimeTicks === undefined) {
|
||
|
throw new Error('Required parameter runtimeTicks was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'actualSegmentLengthTicks' is not null or undefined
|
||
|
if (actualSegmentLengthTicks === null || actualSegmentLengthTicks === undefined) {
|
||
|
throw new Error('Required parameter actualSegmentLengthTicks was null or undefined when calling getHlsAudioSegment.');
|
||
|
}
|
||
|
|
||
|
if (runtimeTicks !== undefined) {
|
||
|
localVarQueryParameters['runtimeTicks'] = ObjectSerializer.serialize(runtimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (actualSegmentLengthTicks !== undefined) {
|
||
|
localVarQueryParameters['actualSegmentLengthTicks'] = ObjectSerializer.serialize(actualSegmentLengthTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxStreamingBitrate !== undefined) {
|
||
|
localVarQueryParameters['maxStreamingBitrate'] = ObjectSerializer.serialize(maxStreamingBitrate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a video stream using HTTP live streaming.
|
||
|
* @param itemId The item id.
|
||
|
* @param playlistId The playlist id.
|
||
|
* @param segmentId The segment id.
|
||
|
* @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.
|
||
|
* @param runtimeTicks The position of the requested segment in ticks.
|
||
|
* @param actualSegmentLengthTicks The length of the requested segment in ticks.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The desired segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param maxWidth Optional. The maximum horizontal resolution of the encoded video.
|
||
|
* @param maxHeight Optional. The maximum vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
*/
|
||
|
public async getHlsVideoSegment (itemId: string, playlistId: string, segmentId: number, container: string, runtimeTicks: number, actualSegmentLengthTicks: number, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, mediaSourceId?: string, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, maxWidth?: number, maxHeight?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
|
||
|
.replace('{' + 'playlistId' + '}', encodeURIComponent(String(playlistId)))
|
||
|
.replace('{' + 'segmentId' + '}', encodeURIComponent(String(segmentId)))
|
||
|
.replace('{' + 'container' + '}', encodeURIComponent(String(container)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['video/*'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'playlistId' is not null or undefined
|
||
|
if (playlistId === null || playlistId === undefined) {
|
||
|
throw new Error('Required parameter playlistId was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'segmentId' is not null or undefined
|
||
|
if (segmentId === null || segmentId === undefined) {
|
||
|
throw new Error('Required parameter segmentId was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'container' is not null or undefined
|
||
|
if (container === null || container === undefined) {
|
||
|
throw new Error('Required parameter container was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'runtimeTicks' is not null or undefined
|
||
|
if (runtimeTicks === null || runtimeTicks === undefined) {
|
||
|
throw new Error('Required parameter runtimeTicks was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'actualSegmentLengthTicks' is not null or undefined
|
||
|
if (actualSegmentLengthTicks === null || actualSegmentLengthTicks === undefined) {
|
||
|
throw new Error('Required parameter actualSegmentLengthTicks was null or undefined when calling getHlsVideoSegment.');
|
||
|
}
|
||
|
|
||
|
if (runtimeTicks !== undefined) {
|
||
|
localVarQueryParameters['runtimeTicks'] = ObjectSerializer.serialize(runtimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (actualSegmentLengthTicks !== undefined) {
|
||
|
localVarQueryParameters['actualSegmentLengthTicks'] = ObjectSerializer.serialize(actualSegmentLengthTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (maxWidth !== undefined) {
|
||
|
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxHeight !== undefined) {
|
||
|
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a hls live stream.
|
||
|
* @param itemId The item id.
|
||
|
* @param container The audio container.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment lenght.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
* @param maxWidth Optional. The max width.
|
||
|
* @param maxHeight Optional. The max height.
|
||
|
* @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest.
|
||
|
*/
|
||
|
public async getLiveHlsStream (itemId: string, container?: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, mediaSourceId?: string, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, maxWidth?: number, maxHeight?: number, enableSubtitlesInManifest?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Videos/{itemId}/live.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getLiveHlsStream.');
|
||
|
}
|
||
|
|
||
|
if (container !== undefined) {
|
||
|
localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string");
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
if (maxWidth !== undefined) {
|
||
|
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxHeight !== undefined) {
|
||
|
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
|
||
|
}
|
||
|
|
||
|
if (enableSubtitlesInManifest !== undefined) {
|
||
|
localVarQueryParameters['enableSubtitlesInManifest'] = ObjectSerializer.serialize(enableSubtitlesInManifest, "boolean");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets an audio hls playlist stream.
|
||
|
* @param itemId The item id.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param maxStreamingBitrate Optional. The maximum streaming bitrate.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
* @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming.
|
||
|
*/
|
||
|
public async getMasterHlsAudioPlaylist (itemId: string, mediaSourceId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, maxStreamingBitrate?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, enableAdaptiveBitrateStreaming?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Audio/{itemId}/master.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getMasterHlsAudioPlaylist.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'mediaSourceId' is not null or undefined
|
||
|
if (mediaSourceId === null || mediaSourceId === undefined) {
|
||
|
throw new Error('Required parameter mediaSourceId was null or undefined when calling getMasterHlsAudioPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxStreamingBitrate !== undefined) {
|
||
|
localVarQueryParameters['maxStreamingBitrate'] = ObjectSerializer.serialize(maxStreamingBitrate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
if (enableAdaptiveBitrateStreaming !== undefined) {
|
||
|
localVarQueryParameters['enableAdaptiveBitrateStreaming'] = ObjectSerializer.serialize(enableAdaptiveBitrateStreaming, "boolean");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a video hls playlist stream.
|
||
|
* @param itemId The item id.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param maxWidth Optional. The maximum horizontal resolution of the encoded video.
|
||
|
* @param maxHeight Optional. The maximum vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
* @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming.
|
||
|
*/
|
||
|
public async getMasterHlsVideoPlaylist (itemId: string, mediaSourceId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, maxWidth?: number, maxHeight?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, enableAdaptiveBitrateStreaming?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Videos/{itemId}/master.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getMasterHlsVideoPlaylist.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'mediaSourceId' is not null or undefined
|
||
|
if (mediaSourceId === null || mediaSourceId === undefined) {
|
||
|
throw new Error('Required parameter mediaSourceId was null or undefined when calling getMasterHlsVideoPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (maxWidth !== undefined) {
|
||
|
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxHeight !== undefined) {
|
||
|
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
if (enableAdaptiveBitrateStreaming !== undefined) {
|
||
|
localVarQueryParameters['enableAdaptiveBitrateStreaming'] = ObjectSerializer.serialize(enableAdaptiveBitrateStreaming, "boolean");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets an audio stream using HTTP live streaming.
|
||
|
* @param itemId The item id.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param maxStreamingBitrate Optional. The maximum streaming bitrate.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vpx, wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
*/
|
||
|
public async getVariantHlsAudioPlaylist (itemId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, mediaSourceId?: string, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, maxStreamingBitrate?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Audio/{itemId}/main.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getVariantHlsAudioPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxStreamingBitrate !== undefined) {
|
||
|
localVarQueryParameters['maxStreamingBitrate'] = ObjectSerializer.serialize(maxStreamingBitrate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a video stream using HTTP live streaming.
|
||
|
* @param itemId The item id.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param maxWidth Optional. The maximum horizontal resolution of the encoded video.
|
||
|
* @param maxHeight Optional. The maximum vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
*/
|
||
|
public async getVariantHlsVideoPlaylist (itemId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, mediaSourceId?: string, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, maxWidth?: number, maxHeight?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Videos/{itemId}/main.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling getVariantHlsVideoPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (maxWidth !== undefined) {
|
||
|
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxHeight !== undefined) {
|
||
|
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'GET',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets an audio hls playlist stream.
|
||
|
* @param itemId The item id.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param maxStreamingBitrate Optional. The maximum streaming bitrate.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
* @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming.
|
||
|
*/
|
||
|
public async headMasterHlsAudioPlaylist (itemId: string, mediaSourceId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, maxStreamingBitrate?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, enableAdaptiveBitrateStreaming?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Audio/{itemId}/master.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling headMasterHlsAudioPlaylist.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'mediaSourceId' is not null or undefined
|
||
|
if (mediaSourceId === null || mediaSourceId === undefined) {
|
||
|
throw new Error('Required parameter mediaSourceId was null or undefined when calling headMasterHlsAudioPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxStreamingBitrate !== undefined) {
|
||
|
localVarQueryParameters['maxStreamingBitrate'] = ObjectSerializer.serialize(maxStreamingBitrate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
if (enableAdaptiveBitrateStreaming !== undefined) {
|
||
|
localVarQueryParameters['enableAdaptiveBitrateStreaming'] = ObjectSerializer.serialize(enableAdaptiveBitrateStreaming, "boolean");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'HEAD',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* @summary Gets a video hls playlist stream.
|
||
|
* @param itemId The item id.
|
||
|
* @param mediaSourceId The media version id, if playing an alternate version.
|
||
|
* @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.
|
||
|
* @param params The streaming parameters.
|
||
|
* @param tag The tag.
|
||
|
* @param deviceProfileId Optional. The dlna device profile id to utilize.
|
||
|
* @param playSessionId The play session id.
|
||
|
* @param segmentContainer The segment container.
|
||
|
* @param segmentLength The segment length.
|
||
|
* @param minSegments The minimum number of segments.
|
||
|
* @param deviceId The device id of the client requesting. Used to stop encoding processes when needed.
|
||
|
* @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url\'s extension. Options: aac, mp3, vorbis, wma.
|
||
|
* @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.
|
||
|
* @param allowVideoStreamCopy Whether or not to allow copying of the video stream url.
|
||
|
* @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url.
|
||
|
* @param breakOnNonKeyFrames Optional. Whether to break on non key frames.
|
||
|
* @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100.
|
||
|
* @param maxAudioBitDepth Optional. The maximum audio bit depth.
|
||
|
* @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.
|
||
|
* @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2.
|
||
|
* @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2.
|
||
|
* @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.
|
||
|
* @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.
|
||
|
* @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.
|
||
|
* @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false.
|
||
|
* @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.
|
||
|
* @param width Optional. The fixed horizontal resolution of the encoded video.
|
||
|
* @param height Optional. The fixed vertical resolution of the encoded video.
|
||
|
* @param maxWidth Optional. The maximum horizontal resolution of the encoded video.
|
||
|
* @param maxHeight Optional. The maximum vertical resolution of the encoded video.
|
||
|
* @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.
|
||
|
* @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.
|
||
|
* @param subtitleMethod Optional. Specify the subtitle delivery method.
|
||
|
* @param maxRefFrames Optional.
|
||
|
* @param maxVideoBitDepth Optional. The maximum video bit depth.
|
||
|
* @param requireAvc Optional. Whether to require avc.
|
||
|
* @param deInterlace Optional. Whether to deinterlace the video.
|
||
|
* @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream.
|
||
|
* @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode.
|
||
|
* @param cpuCoreLimit Optional. The limit of how many cpu cores to use.
|
||
|
* @param liveStreamId The live stream id.
|
||
|
* @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode.
|
||
|
* @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url\'s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.
|
||
|
* @param subtitleCodec Optional. Specify a subtitle codec to encode to.
|
||
|
* @param transcodeReasons Optional. The transcoding reason.
|
||
|
* @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be used.
|
||
|
* @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be used.
|
||
|
* @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext.
|
||
|
* @param streamOptions Optional. The streaming options.
|
||
|
* @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming.
|
||
|
*/
|
||
|
public async headMasterHlsVideoPlaylist (itemId: string, mediaSourceId: string, _static?: boolean, params?: string, tag?: string, deviceProfileId?: string, playSessionId?: string, segmentContainer?: string, segmentLength?: number, minSegments?: number, deviceId?: string, audioCodec?: string, enableAutoStreamCopy?: boolean, allowVideoStreamCopy?: boolean, allowAudioStreamCopy?: boolean, breakOnNonKeyFrames?: boolean, audioSampleRate?: number, maxAudioBitDepth?: number, audioBitRate?: number, audioChannels?: number, maxAudioChannels?: number, profile?: string, level?: string, framerate?: number, maxFramerate?: number, copyTimestamps?: boolean, startTimeTicks?: number, width?: number, height?: number, maxWidth?: number, maxHeight?: number, videoBitRate?: number, subtitleStreamIndex?: number, subtitleMethod?: SubtitleDeliveryMethod, maxRefFrames?: number, maxVideoBitDepth?: number, requireAvc?: boolean, deInterlace?: boolean, requireNonAnamorphic?: boolean, transcodingMaxAudioChannels?: number, cpuCoreLimit?: number, liveStreamId?: string, enableMpegtsM2TsMode?: boolean, videoCodec?: string, subtitleCodec?: string, transcodeReasons?: string, audioStreamIndex?: number, videoStreamIndex?: number, context?: EncodingContext, streamOptions?: { [key: string]: string; }, enableAdaptiveBitrateStreaming?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
||
|
const localVarPath = this.basePath + '/Videos/{itemId}/master.m3u8'
|
||
|
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
|
||
|
let localVarQueryParameters: any = {};
|
||
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||
|
const produces = ['application/x-mpegURL'];
|
||
|
// give precedence to 'application/json'
|
||
|
if (produces.indexOf('application/json') >= 0) {
|
||
|
localVarHeaderParams.Accept = 'application/json';
|
||
|
} else {
|
||
|
localVarHeaderParams.Accept = produces.join(',');
|
||
|
}
|
||
|
let localVarFormParams: any = {};
|
||
|
|
||
|
// verify required parameter 'itemId' is not null or undefined
|
||
|
if (itemId === null || itemId === undefined) {
|
||
|
throw new Error('Required parameter itemId was null or undefined when calling headMasterHlsVideoPlaylist.');
|
||
|
}
|
||
|
|
||
|
// verify required parameter 'mediaSourceId' is not null or undefined
|
||
|
if (mediaSourceId === null || mediaSourceId === undefined) {
|
||
|
throw new Error('Required parameter mediaSourceId was null or undefined when calling headMasterHlsVideoPlaylist.');
|
||
|
}
|
||
|
|
||
|
if (_static !== undefined) {
|
||
|
localVarQueryParameters['static'] = ObjectSerializer.serialize(_static, "boolean");
|
||
|
}
|
||
|
|
||
|
if (params !== undefined) {
|
||
|
localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
|
||
|
}
|
||
|
|
||
|
if (tag !== undefined) {
|
||
|
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceProfileId !== undefined) {
|
||
|
localVarQueryParameters['deviceProfileId'] = ObjectSerializer.serialize(deviceProfileId, "string");
|
||
|
}
|
||
|
|
||
|
if (playSessionId !== undefined) {
|
||
|
localVarQueryParameters['playSessionId'] = ObjectSerializer.serialize(playSessionId, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentContainer !== undefined) {
|
||
|
localVarQueryParameters['segmentContainer'] = ObjectSerializer.serialize(segmentContainer, "string");
|
||
|
}
|
||
|
|
||
|
if (segmentLength !== undefined) {
|
||
|
localVarQueryParameters['segmentLength'] = ObjectSerializer.serialize(segmentLength, "number");
|
||
|
}
|
||
|
|
||
|
if (minSegments !== undefined) {
|
||
|
localVarQueryParameters['minSegments'] = ObjectSerializer.serialize(minSegments, "number");
|
||
|
}
|
||
|
|
||
|
if (mediaSourceId !== undefined) {
|
||
|
localVarQueryParameters['mediaSourceId'] = ObjectSerializer.serialize(mediaSourceId, "string");
|
||
|
}
|
||
|
|
||
|
if (deviceId !== undefined) {
|
||
|
localVarQueryParameters['deviceId'] = ObjectSerializer.serialize(deviceId, "string");
|
||
|
}
|
||
|
|
||
|
if (audioCodec !== undefined) {
|
||
|
localVarQueryParameters['audioCodec'] = ObjectSerializer.serialize(audioCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (enableAutoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['enableAutoStreamCopy'] = ObjectSerializer.serialize(enableAutoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowVideoStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowVideoStreamCopy'] = ObjectSerializer.serialize(allowVideoStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (allowAudioStreamCopy !== undefined) {
|
||
|
localVarQueryParameters['allowAudioStreamCopy'] = ObjectSerializer.serialize(allowAudioStreamCopy, "boolean");
|
||
|
}
|
||
|
|
||
|
if (breakOnNonKeyFrames !== undefined) {
|
||
|
localVarQueryParameters['breakOnNonKeyFrames'] = ObjectSerializer.serialize(breakOnNonKeyFrames, "boolean");
|
||
|
}
|
||
|
|
||
|
if (audioSampleRate !== undefined) {
|
||
|
localVarQueryParameters['audioSampleRate'] = ObjectSerializer.serialize(audioSampleRate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxAudioBitDepth'] = ObjectSerializer.serialize(maxAudioBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (audioBitRate !== undefined) {
|
||
|
localVarQueryParameters['audioBitRate'] = ObjectSerializer.serialize(audioBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (audioChannels !== undefined) {
|
||
|
localVarQueryParameters['audioChannels'] = ObjectSerializer.serialize(audioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (maxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['maxAudioChannels'] = ObjectSerializer.serialize(maxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (profile !== undefined) {
|
||
|
localVarQueryParameters['profile'] = ObjectSerializer.serialize(profile, "string");
|
||
|
}
|
||
|
|
||
|
if (level !== undefined) {
|
||
|
localVarQueryParameters['level'] = ObjectSerializer.serialize(level, "string");
|
||
|
}
|
||
|
|
||
|
if (framerate !== undefined) {
|
||
|
localVarQueryParameters['framerate'] = ObjectSerializer.serialize(framerate, "number");
|
||
|
}
|
||
|
|
||
|
if (maxFramerate !== undefined) {
|
||
|
localVarQueryParameters['maxFramerate'] = ObjectSerializer.serialize(maxFramerate, "number");
|
||
|
}
|
||
|
|
||
|
if (copyTimestamps !== undefined) {
|
||
|
localVarQueryParameters['copyTimestamps'] = ObjectSerializer.serialize(copyTimestamps, "boolean");
|
||
|
}
|
||
|
|
||
|
if (startTimeTicks !== undefined) {
|
||
|
localVarQueryParameters['startTimeTicks'] = ObjectSerializer.serialize(startTimeTicks, "number");
|
||
|
}
|
||
|
|
||
|
if (width !== undefined) {
|
||
|
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
|
||
|
}
|
||
|
|
||
|
if (height !== undefined) {
|
||
|
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
|
||
|
}
|
||
|
|
||
|
if (maxWidth !== undefined) {
|
||
|
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
|
||
|
}
|
||
|
|
||
|
if (maxHeight !== undefined) {
|
||
|
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
|
||
|
}
|
||
|
|
||
|
if (videoBitRate !== undefined) {
|
||
|
localVarQueryParameters['videoBitRate'] = ObjectSerializer.serialize(videoBitRate, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['subtitleStreamIndex'] = ObjectSerializer.serialize(subtitleStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (subtitleMethod !== undefined) {
|
||
|
localVarQueryParameters['subtitleMethod'] = ObjectSerializer.serialize(subtitleMethod, "SubtitleDeliveryMethod");
|
||
|
}
|
||
|
|
||
|
if (maxRefFrames !== undefined) {
|
||
|
localVarQueryParameters['maxRefFrames'] = ObjectSerializer.serialize(maxRefFrames, "number");
|
||
|
}
|
||
|
|
||
|
if (maxVideoBitDepth !== undefined) {
|
||
|
localVarQueryParameters['maxVideoBitDepth'] = ObjectSerializer.serialize(maxVideoBitDepth, "number");
|
||
|
}
|
||
|
|
||
|
if (requireAvc !== undefined) {
|
||
|
localVarQueryParameters['requireAvc'] = ObjectSerializer.serialize(requireAvc, "boolean");
|
||
|
}
|
||
|
|
||
|
if (deInterlace !== undefined) {
|
||
|
localVarQueryParameters['deInterlace'] = ObjectSerializer.serialize(deInterlace, "boolean");
|
||
|
}
|
||
|
|
||
|
if (requireNonAnamorphic !== undefined) {
|
||
|
localVarQueryParameters['requireNonAnamorphic'] = ObjectSerializer.serialize(requireNonAnamorphic, "boolean");
|
||
|
}
|
||
|
|
||
|
if (transcodingMaxAudioChannels !== undefined) {
|
||
|
localVarQueryParameters['transcodingMaxAudioChannels'] = ObjectSerializer.serialize(transcodingMaxAudioChannels, "number");
|
||
|
}
|
||
|
|
||
|
if (cpuCoreLimit !== undefined) {
|
||
|
localVarQueryParameters['cpuCoreLimit'] = ObjectSerializer.serialize(cpuCoreLimit, "number");
|
||
|
}
|
||
|
|
||
|
if (liveStreamId !== undefined) {
|
||
|
localVarQueryParameters['liveStreamId'] = ObjectSerializer.serialize(liveStreamId, "string");
|
||
|
}
|
||
|
|
||
|
if (enableMpegtsM2TsMode !== undefined) {
|
||
|
localVarQueryParameters['enableMpegtsM2TsMode'] = ObjectSerializer.serialize(enableMpegtsM2TsMode, "boolean");
|
||
|
}
|
||
|
|
||
|
if (videoCodec !== undefined) {
|
||
|
localVarQueryParameters['videoCodec'] = ObjectSerializer.serialize(videoCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (subtitleCodec !== undefined) {
|
||
|
localVarQueryParameters['subtitleCodec'] = ObjectSerializer.serialize(subtitleCodec, "string");
|
||
|
}
|
||
|
|
||
|
if (transcodeReasons !== undefined) {
|
||
|
localVarQueryParameters['transcodeReasons'] = ObjectSerializer.serialize(transcodeReasons, "string");
|
||
|
}
|
||
|
|
||
|
if (audioStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['audioStreamIndex'] = ObjectSerializer.serialize(audioStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (videoStreamIndex !== undefined) {
|
||
|
localVarQueryParameters['videoStreamIndex'] = ObjectSerializer.serialize(videoStreamIndex, "number");
|
||
|
}
|
||
|
|
||
|
if (context !== undefined) {
|
||
|
localVarQueryParameters['context'] = ObjectSerializer.serialize(context, "EncodingContext");
|
||
|
}
|
||
|
|
||
|
if (streamOptions !== undefined) {
|
||
|
localVarQueryParameters['streamOptions'] = ObjectSerializer.serialize(streamOptions, "{ [key: string]: string; }");
|
||
|
}
|
||
|
|
||
|
if (enableAdaptiveBitrateStreaming !== undefined) {
|
||
|
localVarQueryParameters['enableAdaptiveBitrateStreaming'] = ObjectSerializer.serialize(enableAdaptiveBitrateStreaming, "boolean");
|
||
|
}
|
||
|
|
||
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||
|
|
||
|
let localVarUseFormData = false;
|
||
|
|
||
|
let localVarRequestOptions: localVarRequest.Options = {
|
||
|
method: 'HEAD',
|
||
|
qs: localVarQueryParameters,
|
||
|
headers: localVarHeaderParams,
|
||
|
uri: localVarPath,
|
||
|
useQuerystring: this._useQuerystring,
|
||
|
encoding: null,
|
||
|
};
|
||
|
|
||
|
let authenticationPromise = Promise.resolve();
|
||
|
if (this.authentications.CustomAuthentication.apiKey) {
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
||
|
}
|
||
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||
|
|
||
|
let interceptorPromise = authenticationPromise;
|
||
|
for (const interceptor of this.interceptors) {
|
||
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||
|
}
|
||
|
|
||
|
return interceptorPromise.then(() => {
|
||
|
if (Object.keys(localVarFormParams).length) {
|
||
|
if (localVarUseFormData) {
|
||
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||
|
} else {
|
||
|
localVarRequestOptions.form = localVarFormParams;
|
||
|
}
|
||
|
}
|
||
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
||
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||
|
if (error) {
|
||
|
reject(error);
|
||
|
} else {
|
||
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
||
|
resolve({ response: response, body: body });
|
||
|
} else {
|
||
|
reject(new HttpError(response, body, response.statusCode));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
}
|