UNPKG

@jellyfin/sdk

Version:
792 lines (791 loc) • 255 kB
import globalAxios from 'axios'; import { assertParamExists, DUMMY_BASE_URL, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from '../common.js'; import { operationServerMap, BaseAPI, BASE_PATH } from '../base.js'; /* tslint:disable */ /* eslint-disable */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit the class manually. * * Jellyfin API * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * DynamicHlsApi - axios parameter creator * @export */ const DynamicHlsApiAxiosParamCreator = function (configuration) { return { /** * * @summary Gets a video stream using HTTP live streaming. * @param {string} itemId The item id. * @param {string} playlistId The playlist id. * @param {number} segmentId The segment id. * @param {string} 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 {number} runtimeTicks The position of the requested segment in ticks. * @param {number} actualSegmentLengthTicks The length of the requested segment in ticks. * @param {boolean} [_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 {string} [params] The streaming parameters. * @param {string} [tag] The tag. * @param {string} [deviceProfileId] Optional. The dlna device profile id to utilize. * @param {string} [playSessionId] The play session id. * @param {string} [segmentContainer] The segment container. * @param {number} [segmentLength] The segment length. * @param {number} [minSegments] The minimum number of segments. * @param {string} [mediaSourceId] The media version id, if playing an alternate version. * @param {string} [deviceId] The device id of the client requesting. Used to stop encoding processes when needed. * @param {string} [audioCodec] Optional. Specify an audio codec to encode to, e.g. mp3. * @param {boolean} [enableAutoStreamCopy] Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. * @param {boolean} [allowVideoStreamCopy] Whether or not to allow copying of the video stream url. * @param {boolean} [allowAudioStreamCopy] Whether or not to allow copying of the audio stream url. * @param {boolean} [breakOnNonKeyFrames] Optional. Whether to break on non key frames. * @param {number} [audioSampleRate] Optional. Specify a specific audio sample rate, e.g. 44100. * @param {number} [maxAudioBitDepth] Optional. The maximum audio bit depth. * @param {number} [maxStreamingBitrate] Optional. The maximum streaming bitrate. * @param {number} [audioBitRate] Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. * @param {number} [audioChannels] Optional. Specify a specific number of audio channels to encode to, e.g. 2. * @param {number} [maxAudioChannels] Optional. Specify a maximum number of audio channels to encode to, e.g. 2. * @param {string} [profile] Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. * @param {string} [level] Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. * @param {number} [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 {number} [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 {boolean} [copyTimestamps] Whether or not to copy timestamps when transcoding with an offset. Defaults to false. * @param {number} [startTimeTicks] Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. * @param {number} [width] Optional. The fixed horizontal resolution of the encoded video. * @param {number} [height] Optional. The fixed vertical resolution of the encoded video. * @param {number} [videoBitRate] Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. * @param {number} [subtitleStreamIndex] Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. * @param {SubtitleDeliveryMethod} [subtitleMethod] Optional. Specify the subtitle delivery method. * @param {number} [maxRefFrames] Optional. * @param {number} [maxVideoBitDepth] Optional. The maximum video bit depth. * @param {boolean} [requireAvc] Optional. Whether to require avc. * @param {boolean} [deInterlace] Optional. Whether to deinterlace the video. * @param {boolean} [requireNonAnamorphic] Optional. Whether to require a non anamorphic stream. * @param {number} [transcodingMaxAudioChannels] Optional. The maximum number of audio channels to transcode. * @param {number} [cpuCoreLimit] Optional. The limit of how many cpu cores to use. * @param {string} [liveStreamId] The live stream id. * @param {boolean} [enableMpegtsM2TsMode] Optional. Whether to enable the MpegtsM2Ts mode. * @param {string} [videoCodec] Optional. Specify a video codec to encode to, e.g. h264. * @param {string} [subtitleCodec] Optional. Specify a subtitle codec to encode to. * @param {string} [transcodeReasons] Optional. The transcoding reason. * @param {number} [audioStreamIndex] Optional. The index of the audio stream to use. If omitted the first audio stream will be used. * @param {number} [videoStreamIndex] Optional. The index of the video stream to use. If omitted the first video stream will be used. * @param {EncodingContext} [context] Optional. The MediaBrowser.Model.Dlna.EncodingContext. * @param {{ [key: string]: string; }} [streamOptions] Optional. The streaming options. * @param {boolean} [enableAudioVbrEncoding] Optional. Whether to enable Audio Encoding. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHlsAudioSegment: async (itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getHlsAudioSegment', 'itemId', itemId); // verify required parameter 'playlistId' is not null or undefined assertParamExists('getHlsAudioSegment', 'playlistId', playlistId); // verify required parameter 'segmentId' is not null or undefined assertParamExists('getHlsAudioSegment', 'segmentId', segmentId); // verify required parameter 'container' is not null or undefined assertParamExists('getHlsAudioSegment', 'container', container); // verify required parameter 'runtimeTicks' is not null or undefined assertParamExists('getHlsAudioSegment', 'runtimeTicks', runtimeTicks); // verify required parameter 'actualSegmentLengthTicks' is not null or undefined assertParamExists('getHlsAudioSegment', 'actualSegmentLengthTicks', actualSegmentLengthTicks); const localVarPath = `/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))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication CustomAuthentication required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration); if (runtimeTicks !== undefined) { localVarQueryParameter['runtimeTicks'] = runtimeTicks; } if (actualSegmentLengthTicks !== undefined) { localVarQueryParameter['actualSegmentLengthTicks'] = actualSegmentLengthTicks; } if (_static !== undefined) { localVarQueryParameter['static'] = _static; } if (params !== undefined) { localVarQueryParameter['params'] = params; } if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (deviceProfileId !== undefined) { localVarQueryParameter['deviceProfileId'] = deviceProfileId; } if (playSessionId !== undefined) { localVarQueryParameter['playSessionId'] = playSessionId; } if (segmentContainer !== undefined) { localVarQueryParameter['segmentContainer'] = segmentContainer; } if (segmentLength !== undefined) { localVarQueryParameter['segmentLength'] = segmentLength; } if (minSegments !== undefined) { localVarQueryParameter['minSegments'] = minSegments; } if (mediaSourceId !== undefined) { localVarQueryParameter['mediaSourceId'] = mediaSourceId; } if (deviceId !== undefined) { localVarQueryParameter['deviceId'] = deviceId; } if (audioCodec !== undefined) { localVarQueryParameter['audioCodec'] = audioCodec; } if (enableAutoStreamCopy !== undefined) { localVarQueryParameter['enableAutoStreamCopy'] = enableAutoStreamCopy; } if (allowVideoStreamCopy !== undefined) { localVarQueryParameter['allowVideoStreamCopy'] = allowVideoStreamCopy; } if (allowAudioStreamCopy !== undefined) { localVarQueryParameter['allowAudioStreamCopy'] = allowAudioStreamCopy; } if (breakOnNonKeyFrames !== undefined) { localVarQueryParameter['breakOnNonKeyFrames'] = breakOnNonKeyFrames; } if (audioSampleRate !== undefined) { localVarQueryParameter['audioSampleRate'] = audioSampleRate; } if (maxAudioBitDepth !== undefined) { localVarQueryParameter['maxAudioBitDepth'] = maxAudioBitDepth; } if (maxStreamingBitrate !== undefined) { localVarQueryParameter['maxStreamingBitrate'] = maxStreamingBitrate; } if (audioBitRate !== undefined) { localVarQueryParameter['audioBitRate'] = audioBitRate; } if (audioChannels !== undefined) { localVarQueryParameter['audioChannels'] = audioChannels; } if (maxAudioChannels !== undefined) { localVarQueryParameter['maxAudioChannels'] = maxAudioChannels; } if (profile !== undefined) { localVarQueryParameter['profile'] = profile; } if (level !== undefined) { localVarQueryParameter['level'] = level; } if (framerate !== undefined) { localVarQueryParameter['framerate'] = framerate; } if (maxFramerate !== undefined) { localVarQueryParameter['maxFramerate'] = maxFramerate; } if (copyTimestamps !== undefined) { localVarQueryParameter['copyTimestamps'] = copyTimestamps; } if (startTimeTicks !== undefined) { localVarQueryParameter['startTimeTicks'] = startTimeTicks; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (videoBitRate !== undefined) { localVarQueryParameter['videoBitRate'] = videoBitRate; } if (subtitleStreamIndex !== undefined) { localVarQueryParameter['subtitleStreamIndex'] = subtitleStreamIndex; } if (subtitleMethod !== undefined) { localVarQueryParameter['subtitleMethod'] = subtitleMethod; } if (maxRefFrames !== undefined) { localVarQueryParameter['maxRefFrames'] = maxRefFrames; } if (maxVideoBitDepth !== undefined) { localVarQueryParameter['maxVideoBitDepth'] = maxVideoBitDepth; } if (requireAvc !== undefined) { localVarQueryParameter['requireAvc'] = requireAvc; } if (deInterlace !== undefined) { localVarQueryParameter['deInterlace'] = deInterlace; } if (requireNonAnamorphic !== undefined) { localVarQueryParameter['requireNonAnamorphic'] = requireNonAnamorphic; } if (transcodingMaxAudioChannels !== undefined) { localVarQueryParameter['transcodingMaxAudioChannels'] = transcodingMaxAudioChannels; } if (cpuCoreLimit !== undefined) { localVarQueryParameter['cpuCoreLimit'] = cpuCoreLimit; } if (liveStreamId !== undefined) { localVarQueryParameter['liveStreamId'] = liveStreamId; } if (enableMpegtsM2TsMode !== undefined) { localVarQueryParameter['enableMpegtsM2TsMode'] = enableMpegtsM2TsMode; } if (videoCodec !== undefined) { localVarQueryParameter['videoCodec'] = videoCodec; } if (subtitleCodec !== undefined) { localVarQueryParameter['subtitleCodec'] = subtitleCodec; } if (transcodeReasons !== undefined) { localVarQueryParameter['transcodeReasons'] = transcodeReasons; } if (audioStreamIndex !== undefined) { localVarQueryParameter['audioStreamIndex'] = audioStreamIndex; } if (videoStreamIndex !== undefined) { localVarQueryParameter['videoStreamIndex'] = videoStreamIndex; } if (context !== undefined) { localVarQueryParameter['context'] = context; } if (streamOptions !== undefined) { for (const [key, value] of Object.entries(streamOptions)) { localVarQueryParameter[key] = value; } } if (enableAudioVbrEncoding !== undefined) { localVarQueryParameter['enableAudioVbrEncoding'] = enableAudioVbrEncoding; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Gets a video stream using HTTP live streaming. * @param {string} itemId The item id. * @param {string} playlistId The playlist id. * @param {number} segmentId The segment id. * @param {string} 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 {number} runtimeTicks The position of the requested segment in ticks. * @param {number} actualSegmentLengthTicks The length of the requested segment in ticks. * @param {boolean} [_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 {string} [params] The streaming parameters. * @param {string} [tag] The tag. * @param {string} [deviceProfileId] Optional. The dlna device profile id to utilize. * @param {string} [playSessionId] The play session id. * @param {string} [segmentContainer] The segment container. * @param {number} [segmentLength] The desired segment length. * @param {number} [minSegments] The minimum number of segments. * @param {string} [mediaSourceId] The media version id, if playing an alternate version. * @param {string} [deviceId] The device id of the client requesting. Used to stop encoding processes when needed. * @param {string} [audioCodec] Optional. Specify an audio codec to encode to, e.g. mp3. * @param {boolean} [enableAutoStreamCopy] Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. * @param {boolean} [allowVideoStreamCopy] Whether or not to allow copying of the video stream url. * @param {boolean} [allowAudioStreamCopy] Whether or not to allow copying of the audio stream url. * @param {boolean} [breakOnNonKeyFrames] Optional. Whether to break on non key frames. * @param {number} [audioSampleRate] Optional. Specify a specific audio sample rate, e.g. 44100. * @param {number} [maxAudioBitDepth] Optional. The maximum audio bit depth. * @param {number} [audioBitRate] Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. * @param {number} [audioChannels] Optional. Specify a specific number of audio channels to encode to, e.g. 2. * @param {number} [maxAudioChannels] Optional. Specify a maximum number of audio channels to encode to, e.g. 2. * @param {string} [profile] Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. * @param {string} [level] Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. * @param {number} [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 {number} [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 {boolean} [copyTimestamps] Whether or not to copy timestamps when transcoding with an offset. Defaults to false. * @param {number} [startTimeTicks] Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. * @param {number} [width] Optional. The fixed horizontal resolution of the encoded video. * @param {number} [height] Optional. The fixed vertical resolution of the encoded video. * @param {number} [maxWidth] Optional. The maximum horizontal resolution of the encoded video. * @param {number} [maxHeight] Optional. The maximum vertical resolution of the encoded video. * @param {number} [videoBitRate] Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. * @param {number} [subtitleStreamIndex] Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. * @param {SubtitleDeliveryMethod} [subtitleMethod] Optional. Specify the subtitle delivery method. * @param {number} [maxRefFrames] Optional. * @param {number} [maxVideoBitDepth] Optional. The maximum video bit depth. * @param {boolean} [requireAvc] Optional. Whether to require avc. * @param {boolean} [deInterlace] Optional. Whether to deinterlace the video. * @param {boolean} [requireNonAnamorphic] Optional. Whether to require a non anamorphic stream. * @param {number} [transcodingMaxAudioChannels] Optional. The maximum number of audio channels to transcode. * @param {number} [cpuCoreLimit] Optional. The limit of how many cpu cores to use. * @param {string} [liveStreamId] The live stream id. * @param {boolean} [enableMpegtsM2TsMode] Optional. Whether to enable the MpegtsM2Ts mode. * @param {string} [videoCodec] Optional. Specify a video codec to encode to, e.g. h264. * @param {string} [subtitleCodec] Optional. Specify a subtitle codec to encode to. * @param {string} [transcodeReasons] Optional. The transcoding reason. * @param {number} [audioStreamIndex] Optional. The index of the audio stream to use. If omitted the first audio stream will be used. * @param {number} [videoStreamIndex] Optional. The index of the video stream to use. If omitted the first video stream will be used. * @param {EncodingContext} [context] Optional. The MediaBrowser.Model.Dlna.EncodingContext. * @param {{ [key: string]: string; }} [streamOptions] Optional. The streaming options. * @param {boolean} [enableAudioVbrEncoding] Optional. Whether to enable Audio Encoding. * @param {boolean} [alwaysBurnInSubtitleWhenTranscoding] Whether to always burn in subtitles when transcoding. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHlsVideoSegment: async (itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getHlsVideoSegment', 'itemId', itemId); // verify required parameter 'playlistId' is not null or undefined assertParamExists('getHlsVideoSegment', 'playlistId', playlistId); // verify required parameter 'segmentId' is not null or undefined assertParamExists('getHlsVideoSegment', 'segmentId', segmentId); // verify required parameter 'container' is not null or undefined assertParamExists('getHlsVideoSegment', 'container', container); // verify required parameter 'runtimeTicks' is not null or undefined assertParamExists('getHlsVideoSegment', 'runtimeTicks', runtimeTicks); // verify required parameter 'actualSegmentLengthTicks' is not null or undefined assertParamExists('getHlsVideoSegment', 'actualSegmentLengthTicks', actualSegmentLengthTicks); const localVarPath = `/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))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication CustomAuthentication required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration); if (runtimeTicks !== undefined) { localVarQueryParameter['runtimeTicks'] = runtimeTicks; } if (actualSegmentLengthTicks !== undefined) { localVarQueryParameter['actualSegmentLengthTicks'] = actualSegmentLengthTicks; } if (_static !== undefined) { localVarQueryParameter['static'] = _static; } if (params !== undefined) { localVarQueryParameter['params'] = params; } if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (deviceProfileId !== undefined) { localVarQueryParameter['deviceProfileId'] = deviceProfileId; } if (playSessionId !== undefined) { localVarQueryParameter['playSessionId'] = playSessionId; } if (segmentContainer !== undefined) { localVarQueryParameter['segmentContainer'] = segmentContainer; } if (segmentLength !== undefined) { localVarQueryParameter['segmentLength'] = segmentLength; } if (minSegments !== undefined) { localVarQueryParameter['minSegments'] = minSegments; } if (mediaSourceId !== undefined) { localVarQueryParameter['mediaSourceId'] = mediaSourceId; } if (deviceId !== undefined) { localVarQueryParameter['deviceId'] = deviceId; } if (audioCodec !== undefined) { localVarQueryParameter['audioCodec'] = audioCodec; } if (enableAutoStreamCopy !== undefined) { localVarQueryParameter['enableAutoStreamCopy'] = enableAutoStreamCopy; } if (allowVideoStreamCopy !== undefined) { localVarQueryParameter['allowVideoStreamCopy'] = allowVideoStreamCopy; } if (allowAudioStreamCopy !== undefined) { localVarQueryParameter['allowAudioStreamCopy'] = allowAudioStreamCopy; } if (breakOnNonKeyFrames !== undefined) { localVarQueryParameter['breakOnNonKeyFrames'] = breakOnNonKeyFrames; } if (audioSampleRate !== undefined) { localVarQueryParameter['audioSampleRate'] = audioSampleRate; } if (maxAudioBitDepth !== undefined) { localVarQueryParameter['maxAudioBitDepth'] = maxAudioBitDepth; } if (audioBitRate !== undefined) { localVarQueryParameter['audioBitRate'] = audioBitRate; } if (audioChannels !== undefined) { localVarQueryParameter['audioChannels'] = audioChannels; } if (maxAudioChannels !== undefined) { localVarQueryParameter['maxAudioChannels'] = maxAudioChannels; } if (profile !== undefined) { localVarQueryParameter['profile'] = profile; } if (level !== undefined) { localVarQueryParameter['level'] = level; } if (framerate !== undefined) { localVarQueryParameter['framerate'] = framerate; } if (maxFramerate !== undefined) { localVarQueryParameter['maxFramerate'] = maxFramerate; } if (copyTimestamps !== undefined) { localVarQueryParameter['copyTimestamps'] = copyTimestamps; } if (startTimeTicks !== undefined) { localVarQueryParameter['startTimeTicks'] = startTimeTicks; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (videoBitRate !== undefined) { localVarQueryParameter['videoBitRate'] = videoBitRate; } if (subtitleStreamIndex !== undefined) { localVarQueryParameter['subtitleStreamIndex'] = subtitleStreamIndex; } if (subtitleMethod !== undefined) { localVarQueryParameter['subtitleMethod'] = subtitleMethod; } if (maxRefFrames !== undefined) { localVarQueryParameter['maxRefFrames'] = maxRefFrames; } if (maxVideoBitDepth !== undefined) { localVarQueryParameter['maxVideoBitDepth'] = maxVideoBitDepth; } if (requireAvc !== undefined) { localVarQueryParameter['requireAvc'] = requireAvc; } if (deInterlace !== undefined) { localVarQueryParameter['deInterlace'] = deInterlace; } if (requireNonAnamorphic !== undefined) { localVarQueryParameter['requireNonAnamorphic'] = requireNonAnamorphic; } if (transcodingMaxAudioChannels !== undefined) { localVarQueryParameter['transcodingMaxAudioChannels'] = transcodingMaxAudioChannels; } if (cpuCoreLimit !== undefined) { localVarQueryParameter['cpuCoreLimit'] = cpuCoreLimit; } if (liveStreamId !== undefined) { localVarQueryParameter['liveStreamId'] = liveStreamId; } if (enableMpegtsM2TsMode !== undefined) { localVarQueryParameter['enableMpegtsM2TsMode'] = enableMpegtsM2TsMode; } if (videoCodec !== undefined) { localVarQueryParameter['videoCodec'] = videoCodec; } if (subtitleCodec !== undefined) { localVarQueryParameter['subtitleCodec'] = subtitleCodec; } if (transcodeReasons !== undefined) { localVarQueryParameter['transcodeReasons'] = transcodeReasons; } if (audioStreamIndex !== undefined) { localVarQueryParameter['audioStreamIndex'] = audioStreamIndex; } if (videoStreamIndex !== undefined) { localVarQueryParameter['videoStreamIndex'] = videoStreamIndex; } if (context !== undefined) { localVarQueryParameter['context'] = context; } if (streamOptions !== undefined) { for (const [key, value] of Object.entries(streamOptions)) { localVarQueryParameter[key] = value; } } if (enableAudioVbrEncoding !== undefined) { localVarQueryParameter['enableAudioVbrEncoding'] = enableAudioVbrEncoding; } if (alwaysBurnInSubtitleWhenTranscoding !== undefined) { localVarQueryParameter['alwaysBurnInSubtitleWhenTranscoding'] = alwaysBurnInSubtitleWhenTranscoding; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Gets a hls live stream. * @param {string} itemId The item id. * @param {string} [container] The audio container. * @param {boolean} [_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 {string} [params] The streaming parameters. * @param {string} [tag] The tag. * @param {string} [deviceProfileId] Optional. The dlna device profile id to utilize. * @param {string} [playSessionId] The play session id. * @param {string} [segmentContainer] The segment container. * @param {number} [segmentLength] The segment length. * @param {number} [minSegments] The minimum number of segments. * @param {string} [mediaSourceId] The media version id, if playing an alternate version. * @param {string} [deviceId] The device id of the client requesting. Used to stop encoding processes when needed. * @param {string} [audioCodec] Optional. Specify an audio codec to encode to, e.g. mp3. * @param {boolean} [enableAutoStreamCopy] Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. * @param {boolean} [allowVideoStreamCopy] Whether or not to allow copying of the video stream url. * @param {boolean} [allowAudioStreamCopy] Whether or not to allow copying of the audio stream url. * @param {boolean} [breakOnNonKeyFrames] Optional. Whether to break on non key frames. * @param {number} [audioSampleRate] Optional. Specify a specific audio sample rate, e.g. 44100. * @param {number} [maxAudioBitDepth] Optional. The maximum audio bit depth. * @param {number} [audioBitRate] Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. * @param {number} [audioChannels] Optional. Specify a specific number of audio channels to encode to, e.g. 2. * @param {number} [maxAudioChannels] Optional. Specify a maximum number of audio channels to encode to, e.g. 2. * @param {string} [profile] Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. * @param {string} [level] Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. * @param {number} [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 {number} [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 {boolean} [copyTimestamps] Whether or not to copy timestamps when transcoding with an offset. Defaults to false. * @param {number} [startTimeTicks] Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. * @param {number} [width] Optional. The fixed horizontal resolution of the encoded video. * @param {number} [height] Optional. The fixed vertical resolution of the encoded video. * @param {number} [videoBitRate] Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. * @param {number} [subtitleStreamIndex] Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. * @param {SubtitleDeliveryMethod} [subtitleMethod] Optional. Specify the subtitle delivery method. * @param {number} [maxRefFrames] Optional. * @param {number} [maxVideoBitDepth] Optional. The maximum video bit depth. * @param {boolean} [requireAvc] Optional. Whether to require avc. * @param {boolean} [deInterlace] Optional. Whether to deinterlace the video. * @param {boolean} [requireNonAnamorphic] Optional. Whether to require a non anamorphic stream. * @param {number} [transcodingMaxAudioChannels] Optional. The maximum number of audio channels to transcode. * @param {number} [cpuCoreLimit] Optional. The limit of how many cpu cores to use. * @param {string} [liveStreamId] The live stream id. * @param {boolean} [enableMpegtsM2TsMode] Optional. Whether to enable the MpegtsM2Ts mode. * @param {string} [videoCodec] Optional. Specify a video codec to encode to, e.g. h264. * @param {string} [subtitleCodec] Optional. Specify a subtitle codec to encode to. * @param {string} [transcodeReasons] Optional. The transcoding reason. * @param {number} [audioStreamIndex] Optional. The index of the audio stream to use. If omitted the first audio stream will be used. * @param {number} [videoStreamIndex] Optional. The index of the video stream to use. If omitted the first video stream will be used. * @param {EncodingContext} [context] Optional. The MediaBrowser.Model.Dlna.EncodingContext. * @param {{ [key: string]: string; }} [streamOptions] Optional. The streaming options. * @param {number} [maxWidth] Optional. The max width. * @param {number} [maxHeight] Optional. The max height. * @param {boolean} [enableSubtitlesInManifest] Optional. Whether to enable subtitles in the manifest. * @param {boolean} [enableAudioVbrEncoding] Optional. Whether to enable Audio Encoding. * @param {boolean} [alwaysBurnInSubtitleWhenTranscoding] Whether to always burn in subtitles when transcoding. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveHlsStream: async (itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getLiveHlsStream', 'itemId', itemId); const localVarPath = `/Videos/{itemId}/live.m3u8` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication CustomAuthentication required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration); if (container !== undefined) { localVarQueryParameter['container'] = container; } if (_static !== undefined) { localVarQueryParameter['static'] = _static; } if (params !== undefined) { localVarQueryParameter['params'] = params; } if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (deviceProfileId !== undefined) { localVarQueryParameter['deviceProfileId'] = deviceProfileId; } if (playSessionId !== undefined) { localVarQueryParameter['playSessionId'] = playSessionId; } if (segmentContainer !== undefined) { localVarQueryParameter['segmentContainer'] = segmentContainer; } if (segmentLength !== undefined) { localVarQueryParameter['segmentLength'] = segmentLength; } if (minSegments !== undefined) { localVarQueryParameter['minSegments'] = minSegments; } if (mediaSourceId !== undefined) { localVarQueryParameter['mediaSourceId'] = mediaSourceId; } if (deviceId !== undefined) { localVarQueryParameter['deviceId'] = deviceId; } if (audioCodec !== undefined) { localVarQueryParameter['audioCodec'] = audioCodec; } if (enableAutoStreamCopy !== undefined) { localVarQueryParameter['enableAutoStreamCopy'] = enableAutoStreamCopy; } if (allowVideoStreamCopy !== undefined) { localVarQueryParameter['allowVideoStreamCopy'] = allowVideoStreamCopy; } if (allowAudioStreamCopy !== undefined) { localVarQueryParameter['allowAudioStreamCopy'] = allowAudioStreamCopy; } if (breakOnNonKeyFrames !== undefined) { localVarQueryParameter['breakOnNonKeyFrames'] = breakOnNonKeyFrames; } if (audioSampleRate !== undefined) { localVarQueryParameter['audioSampleRate'] = audioSampleRate; } if (maxAudioBitDepth !== undefined) { localVarQueryParameter['maxAudioBitDepth'] = maxAudioBitDepth; } if (audioBitRate !== undefined) { localVarQueryParameter['audioBitRate'] = audioBitRate; } if (audioChannels !== undefined) { localVarQueryParameter['audioChannels'] = audioChannels; } if (maxAudioChannels !== undefined) { localVarQueryParameter['maxAudioChannels'] = maxAudioChannels; } if (profile !== undefined) { localVarQueryParameter['profile'] = profile; } if (level !== undefined) { localVarQueryParameter['level'] = level; } if (framerate !== undefined) { localVarQueryParameter['framerate'] = framerate; } if (maxFramerate !== undefined) { localVarQueryParameter['maxFramerate'] = maxFramerate; } if (copyTimestamps !== undefined) { localVarQueryParameter['copyTimestamps'] = copyTimestamps; } if (startTimeTicks !== undefined) { localVarQueryParameter['startTimeTicks'] = startTimeTicks; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (videoBitRate !== undefined) { localVarQueryParameter['videoBitRate'] = videoBitRate; } if (subtitleStreamIndex !== undefined) { localVarQueryParameter['subtitleStreamIndex'] = subtitleStreamIndex; } if (subtitleMethod !== undefined) { localVarQueryParameter['subtitleMethod'] = subtitleMethod; } if (maxRefFrames !== undefined) { localVarQueryParameter['maxRefFrames'] = maxRefFrames; } if (maxVideoBitDepth !== undefined) { localVarQueryParameter['maxVideoBitDepth'] = maxVideoBitDepth; } if (requireAvc !== undefined) { localVarQueryParameter['requireAvc'] = requireAvc; } if (deInterlace !== undefined) { localVarQueryParameter['deInterlace'] = deInterlace; } if (requireNonAnamorphic !== undefined) { localVarQueryParameter['requireNonAnamorphic'] = requireNonAnamorphic; } if (transcodingMaxAudioChannels !== undefined) { localVarQueryParameter['transcodingMaxAudioChannels'] = transcodingMaxAudioChannels; } if (cpuCoreLimit !== undefined) { localVarQueryParameter['cpuCoreLimit'] = cpuCoreLimit; } if (liveStreamId !== undefined) { localVarQueryParameter['liveStreamId'] = liveStreamId; } if (enableMpegtsM2TsMode !== undefined) { localVarQueryParameter['enableMpegtsM2TsMode'] = enableMpegtsM2TsMode; } if (videoCodec !== undefined) { localVarQueryParameter['videoCodec'] = videoCodec; } if (subtitleCodec !== undefined) { localVarQueryParameter['subtitleCodec'] = subtitleCodec; } if (transcodeReasons !== undefined) { localVarQueryParameter['transcodeReasons'] = transcodeReasons; } if (audioStreamIndex !== undefined) { localVarQueryParameter['audioStreamIndex'] = audioStreamIndex; } if (videoStreamIndex !== undefined) { localVarQueryParameter['videoStreamIndex'] = videoStreamIndex; } if (context !== undefined) { localVarQueryParameter['context'] = context; } if (streamOptions !== undefined) { for (const [key, value] of Object.entries(streamOptions)) { localVarQueryParameter[key] = value; } } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (enableSubtitlesInManifest !== undefined) { localVarQueryParameter['enableSubtitlesInManifest'] = enableSubtitlesInManifest; } if (enableAudioVbrEncoding !== undefined) { localVarQueryParameter['enableAudioVbrEncoding'] = enableAudioVbrEncoding; } if (alwaysBurnInSubtitleWhenTranscoding !== undefined) { localVarQueryParameter['alwaysBurnInSubtitleWhenTranscoding'] = alwaysBurnInSubtitleWhenTranscoding; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Gets an audio hls playlist stream. * @param {string} itemId The item id. * @param {string} mediaSourceId The media version id, if playing an alternate version. * @param {boolean} [_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 {string} [params] The streaming parameters. * @param {string} [tag] The tag. * @param {string} [deviceProfileId] Optional. The dlna device profile id to utilize. * @param {string} [playSessionId] The play session id. * @param {string} [segmentContainer