jellyflood/JellyfinPlayer/Swaggers/APIs/MediaInfoAPI.swift

937 lines
35 KiB
Swift

//
// MediaInfoAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
import Alamofire
open class MediaInfoAPI {
/**
Closes a media source.
- parameter liveStreamId: (query) The livestream id.
- parameter completion: completion handler to receive the data and the error objects
*/
open class func closeLiveStream(liveStreamId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
closeLiveStreamWithRequestBuilder(liveStreamId: liveStreamId).execute { (response, error) -> Void in
if error == nil {
completion((), error)
} else {
completion(nil, error)
}
}
}
/**
Closes a media source.
- POST /LiveStreams/Close
-
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- parameter liveStreamId: (query) The livestream id.
- returns: RequestBuilder<Void>
*/
open class func closeLiveStreamWithRequestBuilder(liveStreamId: String) -> RequestBuilder<Void> {
let path = "/LiveStreams/Close"
let URLString = SwaggerClientAPI.basePath + path
let parameters: [String:Any]? = nil
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"liveStreamId": liveStreamId
])
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
/**
Tests the network with a request with the size of the bitrate.
- parameter size: (query) The bitrate. Defaults to 102400. (optional, default to 102400)
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getBitrateTestBytes(size: Int? = nil, completion: @escaping ((_ data: Data?,_ error: Error?) -> Void)) {
getBitrateTestBytesWithRequestBuilder(size: size).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Tests the network with a request with the size of the bitrate.
- GET /Playback/BitrateTest
-
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- examples: [{contentType=application/json, example=""}]
- parameter size: (query) The bitrate. Defaults to 102400. (optional, default to 102400)
- returns: RequestBuilder<Data>
*/
open class func getBitrateTestBytesWithRequestBuilder(size: Int? = nil) -> RequestBuilder<Data> {
let path = "/Playback/BitrateTest"
let URLString = SwaggerClientAPI.basePath + path
let parameters: [String:Any]? = nil
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"size": size?.encodeToJSON()
])
let requestBuilder: RequestBuilder<Data>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
/**
Gets live playback media info for an item.
- parameter itemId: (path) The item id.
- parameter userId: (query) The user id.
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getPlaybackInfo(itemId: UUID, userId: UUID, completion: @escaping ((_ data: PlaybackInfoResponse?,_ error: Error?) -> Void)) {
getPlaybackInfoWithRequestBuilder(itemId: itemId, userId: userId).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Gets live playback media info for an item.
- GET /Items/{itemId}/PlaybackInfo
-
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- examples: [{contentType=application/json, example={
"PlaySessionId" : "PlaySessionId",
"MediaSources" : [ {
"EncoderPath" : "EncoderPath",
"RequiredHttpHeaders" : {
"key" : "RequiredHttpHeaders"
},
"RunTimeTicks" : 5,
"MediaStreams" : [ {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
}, {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
} ],
"Size" : 5,
"Video3DFormat" : "",
"BufferMs" : 2,
"Timestamp" : "",
"Name" : "Name",
"RequiresOpening" : true,
"SupportsDirectStream" : true,
"VideoType" : "",
"RequiresClosing" : true,
"Container" : "Container",
"IsoType" : "",
"LiveStreamId" : "LiveStreamId",
"RequiresLooping" : true,
"Protocol" : "",
"DefaultSubtitleStreamIndex" : 8,
"GenPtsInput" : true,
"IsInfiniteStream" : true,
"Path" : "Path",
"IsRemote" : true,
"EncoderProtocol" : "",
"IgnoreIndex" : true,
"SupportsDirectPlay" : true,
"TranscodingSubProtocol" : "TranscodingSubProtocol",
"Formats" : [ "Formats", "Formats" ],
"AnalyzeDurationMs" : 9,
"Bitrate" : 9,
"OpenToken" : "OpenToken",
"SupportsProbing" : true,
"Type" : "",
"MediaAttachments" : [ {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
}, {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
} ],
"ReadAtNativeFramerate" : true,
"ETag" : "ETag",
"TranscodingContainer" : "TranscodingContainer",
"IgnoreDts" : true,
"TranscodingUrl" : "TranscodingUrl",
"Id" : "Id",
"SupportsTranscoding" : true,
"DefaultAudioStreamIndex" : 6
}, {
"EncoderPath" : "EncoderPath",
"RequiredHttpHeaders" : {
"key" : "RequiredHttpHeaders"
},
"RunTimeTicks" : 5,
"MediaStreams" : [ {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
}, {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
} ],
"Size" : 5,
"Video3DFormat" : "",
"BufferMs" : 2,
"Timestamp" : "",
"Name" : "Name",
"RequiresOpening" : true,
"SupportsDirectStream" : true,
"VideoType" : "",
"RequiresClosing" : true,
"Container" : "Container",
"IsoType" : "",
"LiveStreamId" : "LiveStreamId",
"RequiresLooping" : true,
"Protocol" : "",
"DefaultSubtitleStreamIndex" : 8,
"GenPtsInput" : true,
"IsInfiniteStream" : true,
"Path" : "Path",
"IsRemote" : true,
"EncoderProtocol" : "",
"IgnoreIndex" : true,
"SupportsDirectPlay" : true,
"TranscodingSubProtocol" : "TranscodingSubProtocol",
"Formats" : [ "Formats", "Formats" ],
"AnalyzeDurationMs" : 9,
"Bitrate" : 9,
"OpenToken" : "OpenToken",
"SupportsProbing" : true,
"Type" : "",
"MediaAttachments" : [ {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
}, {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
} ],
"ReadAtNativeFramerate" : true,
"ETag" : "ETag",
"TranscodingContainer" : "TranscodingContainer",
"IgnoreDts" : true,
"TranscodingUrl" : "TranscodingUrl",
"Id" : "Id",
"SupportsTranscoding" : true,
"DefaultAudioStreamIndex" : 6
} ],
"ErrorCode" : ""
}}]
- parameter itemId: (path) The item id.
- parameter userId: (query) The user id.
- returns: RequestBuilder<PlaybackInfoResponse>
*/
open class func getPlaybackInfoWithRequestBuilder(itemId: UUID, userId: UUID) -> RequestBuilder<PlaybackInfoResponse> {
var path = "/Items/{itemId}/PlaybackInfo"
let itemIdPreEscape = "\(itemId)"
let itemIdPostEscape = itemIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
path = path.replacingOccurrences(of: "{itemId}", with: itemIdPostEscape, options: .literal, range: nil)
let URLString = SwaggerClientAPI.basePath + path
let parameters: [String:Any]? = nil
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"userId": userId
])
let requestBuilder: RequestBuilder<PlaybackInfoResponse>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
/**
Gets live playback media info for an item.
- parameter itemId: (path) The item id.
- parameter body: (body) The playback info. (optional)
- parameter userId: (query) The user id. (optional)
- parameter maxStreamingBitrate: (query) The maximum streaming bitrate. (optional)
- parameter startTimeTicks: (query) The start time in ticks. (optional)
- parameter audioStreamIndex: (query) The audio stream index. (optional)
- parameter subtitleStreamIndex: (query) The subtitle stream index. (optional)
- parameter maxAudioChannels: (query) The maximum number of audio channels. (optional)
- parameter mediaSourceId: (query) The media source id. (optional)
- parameter liveStreamId: (query) The livestream id. (optional)
- parameter autoOpenLiveStream: (query) Whether to auto open the livestream. (optional)
- parameter enableDirectPlay: (query) Whether to enable direct play. Default: true. (optional)
- parameter enableDirectStream: (query) Whether to enable direct stream. Default: true. (optional)
- parameter enableTranscoding: (query) Whether to enable transcoding. Default: true. (optional)
- parameter allowVideoStreamCopy: (query) Whether to allow to copy the video stream. Default: true. (optional)
- parameter allowAudioStreamCopy: (query) Whether to allow to copy the audio stream. Default: true. (optional)
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getPostedPlaybackInfo(itemId: UUID, body: ItemIdPlaybackInfoBody? = nil, userId: UUID? = nil, maxStreamingBitrate: Int? = nil, startTimeTicks: Int64? = nil, audioStreamIndex: Int? = nil, subtitleStreamIndex: Int? = nil, maxAudioChannels: Int? = nil, mediaSourceId: String? = nil, liveStreamId: String? = nil, autoOpenLiveStream: Bool? = nil, enableDirectPlay: Bool? = nil, enableDirectStream: Bool? = nil, enableTranscoding: Bool? = nil, allowVideoStreamCopy: Bool? = nil, allowAudioStreamCopy: Bool? = nil, completion: @escaping ((_ data: PlaybackInfoResponse?,_ error: Error?) -> Void)) {
getPostedPlaybackInfoWithRequestBuilder(itemId: itemId, body: body, userId: userId, maxStreamingBitrate: maxStreamingBitrate, startTimeTicks: startTimeTicks, audioStreamIndex: audioStreamIndex, subtitleStreamIndex: subtitleStreamIndex, maxAudioChannels: maxAudioChannels, mediaSourceId: mediaSourceId, liveStreamId: liveStreamId, autoOpenLiveStream: autoOpenLiveStream, enableDirectPlay: enableDirectPlay, enableDirectStream: enableDirectStream, enableTranscoding: enableTranscoding, allowVideoStreamCopy: allowVideoStreamCopy, allowAudioStreamCopy: allowAudioStreamCopy).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Gets live playback media info for an item.
- POST /Items/{itemId}/PlaybackInfo
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- examples: [{contentType=application/json, example={
"PlaySessionId" : "PlaySessionId",
"MediaSources" : [ {
"EncoderPath" : "EncoderPath",
"RequiredHttpHeaders" : {
"key" : "RequiredHttpHeaders"
},
"RunTimeTicks" : 5,
"MediaStreams" : [ {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
}, {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
} ],
"Size" : 5,
"Video3DFormat" : "",
"BufferMs" : 2,
"Timestamp" : "",
"Name" : "Name",
"RequiresOpening" : true,
"SupportsDirectStream" : true,
"VideoType" : "",
"RequiresClosing" : true,
"Container" : "Container",
"IsoType" : "",
"LiveStreamId" : "LiveStreamId",
"RequiresLooping" : true,
"Protocol" : "",
"DefaultSubtitleStreamIndex" : 8,
"GenPtsInput" : true,
"IsInfiniteStream" : true,
"Path" : "Path",
"IsRemote" : true,
"EncoderProtocol" : "",
"IgnoreIndex" : true,
"SupportsDirectPlay" : true,
"TranscodingSubProtocol" : "TranscodingSubProtocol",
"Formats" : [ "Formats", "Formats" ],
"AnalyzeDurationMs" : 9,
"Bitrate" : 9,
"OpenToken" : "OpenToken",
"SupportsProbing" : true,
"Type" : "",
"MediaAttachments" : [ {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
}, {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
} ],
"ReadAtNativeFramerate" : true,
"ETag" : "ETag",
"TranscodingContainer" : "TranscodingContainer",
"IgnoreDts" : true,
"TranscodingUrl" : "TranscodingUrl",
"Id" : "Id",
"SupportsTranscoding" : true,
"DefaultAudioStreamIndex" : 6
}, {
"EncoderPath" : "EncoderPath",
"RequiredHttpHeaders" : {
"key" : "RequiredHttpHeaders"
},
"RunTimeTicks" : 5,
"MediaStreams" : [ {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
}, {
"VideoRange" : "VideoRange",
"CodecTimeBase" : "CodecTimeBase",
"ColorSpace" : "ColorSpace",
"Index" : 7,
"ColorRange" : "ColorRange",
"localizedForced" : "localizedForced",
"BitDepth" : 9,
"Channels" : 4,
"Profile" : "Profile",
"SupportsExternalStream" : true,
"localizedDefault" : "localizedDefault",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"ColorPrimaries" : "ColorPrimaries",
"SampleRate" : 7,
"Language" : "Language",
"IsTextSubtitleStream" : true,
"IsAnamorphic" : true,
"NalLengthSize" : "NalLengthSize",
"Height" : 1,
"PixelFormat" : "PixelFormat",
"RefFrames" : 3,
"IsAVC" : true,
"Width" : 1,
"TimeBase" : "TimeBase",
"ColorTransfer" : "ColorTransfer",
"CodecTag" : "CodecTag",
"IsDefault" : true,
"Path" : "Path",
"Comment" : "Comment",
"DeliveryMethod" : "",
"IsExternalUrl" : true,
"DisplayTitle" : "DisplayTitle",
"IsForced" : true,
"ChannelLayout" : "ChannelLayout",
"localizedUndefined" : "localizedUndefined",
"PacketLength" : 2,
"Title" : "Title",
"RealFrameRate" : 6.846853,
"AspectRatio" : "AspectRatio",
"AverageFrameRate" : 1.4894159,
"Type" : "",
"Score" : 1,
"IsExternal" : true,
"IsInterlaced" : true,
"Level" : 4.965218492984954,
"BitRate" : 7
} ],
"Size" : 5,
"Video3DFormat" : "",
"BufferMs" : 2,
"Timestamp" : "",
"Name" : "Name",
"RequiresOpening" : true,
"SupportsDirectStream" : true,
"VideoType" : "",
"RequiresClosing" : true,
"Container" : "Container",
"IsoType" : "",
"LiveStreamId" : "LiveStreamId",
"RequiresLooping" : true,
"Protocol" : "",
"DefaultSubtitleStreamIndex" : 8,
"GenPtsInput" : true,
"IsInfiniteStream" : true,
"Path" : "Path",
"IsRemote" : true,
"EncoderProtocol" : "",
"IgnoreIndex" : true,
"SupportsDirectPlay" : true,
"TranscodingSubProtocol" : "TranscodingSubProtocol",
"Formats" : [ "Formats", "Formats" ],
"AnalyzeDurationMs" : 9,
"Bitrate" : 9,
"OpenToken" : "OpenToken",
"SupportsProbing" : true,
"Type" : "",
"MediaAttachments" : [ {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
}, {
"CodecTag" : "CodecTag",
"Comment" : "Comment",
"DeliveryUrl" : "DeliveryUrl",
"Codec" : "Codec",
"FileName" : "FileName",
"Index" : 5,
"MimeType" : "MimeType"
} ],
"ReadAtNativeFramerate" : true,
"ETag" : "ETag",
"TranscodingContainer" : "TranscodingContainer",
"IgnoreDts" : true,
"TranscodingUrl" : "TranscodingUrl",
"Id" : "Id",
"SupportsTranscoding" : true,
"DefaultAudioStreamIndex" : 6
} ],
"ErrorCode" : ""
}}]
- parameter itemId: (path) The item id.
- parameter body: (body) The playback info. (optional)
- parameter userId: (query) The user id. (optional)
- parameter maxStreamingBitrate: (query) The maximum streaming bitrate. (optional)
- parameter startTimeTicks: (query) The start time in ticks. (optional)
- parameter audioStreamIndex: (query) The audio stream index. (optional)
- parameter subtitleStreamIndex: (query) The subtitle stream index. (optional)
- parameter maxAudioChannels: (query) The maximum number of audio channels. (optional)
- parameter mediaSourceId: (query) The media source id. (optional)
- parameter liveStreamId: (query) The livestream id. (optional)
- parameter autoOpenLiveStream: (query) Whether to auto open the livestream. (optional)
- parameter enableDirectPlay: (query) Whether to enable direct play. Default: true. (optional)
- parameter enableDirectStream: (query) Whether to enable direct stream. Default: true. (optional)
- parameter enableTranscoding: (query) Whether to enable transcoding. Default: true. (optional)
- parameter allowVideoStreamCopy: (query) Whether to allow to copy the video stream. Default: true. (optional)
- parameter allowAudioStreamCopy: (query) Whether to allow to copy the audio stream. Default: true. (optional)
- returns: RequestBuilder<PlaybackInfoResponse>
*/
open class func getPostedPlaybackInfoWithRequestBuilder(itemId: UUID, body: ItemIdPlaybackInfoBody? = nil, userId: UUID? = nil, maxStreamingBitrate: Int? = nil, startTimeTicks: Int64? = nil, audioStreamIndex: Int? = nil, subtitleStreamIndex: Int? = nil, maxAudioChannels: Int? = nil, mediaSourceId: String? = nil, liveStreamId: String? = nil, autoOpenLiveStream: Bool? = nil, enableDirectPlay: Bool? = nil, enableDirectStream: Bool? = nil, enableTranscoding: Bool? = nil, allowVideoStreamCopy: Bool? = nil, allowAudioStreamCopy: Bool? = nil) -> RequestBuilder<PlaybackInfoResponse> {
var path = "/Items/{itemId}/PlaybackInfo"
let itemIdPreEscape = "\(itemId)"
let itemIdPostEscape = itemIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
path = path.replacingOccurrences(of: "{itemId}", with: itemIdPostEscape, options: .literal, range: nil)
let URLString = SwaggerClientAPI.basePath + path
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"userId": userId,
"maxStreamingBitrate": maxStreamingBitrate?.encodeToJSON(),
"startTimeTicks": startTimeTicks?.encodeToJSON(),
"audioStreamIndex": audioStreamIndex?.encodeToJSON(),
"subtitleStreamIndex": subtitleStreamIndex?.encodeToJSON(),
"maxAudioChannels": maxAudioChannels?.encodeToJSON(),
"mediaSourceId": mediaSourceId,
"liveStreamId": liveStreamId,
"autoOpenLiveStream": autoOpenLiveStream,
"enableDirectPlay": enableDirectPlay,
"enableDirectStream": enableDirectStream,
"enableTranscoding": enableTranscoding,
"allowVideoStreamCopy": allowVideoStreamCopy,
"allowAudioStreamCopy": allowAudioStreamCopy
])
let requestBuilder: RequestBuilder<PlaybackInfoResponse>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
}
/**
Opens a media source.
- parameter body: (body) The open live stream dto. (optional)
- parameter openToken: (query) The open token. (optional)
- parameter userId: (query) The user id. (optional)
- parameter playSessionId: (query) The play session id. (optional)
- parameter maxStreamingBitrate: (query) The maximum streaming bitrate. (optional)
- parameter startTimeTicks: (query) The start time in ticks. (optional)
- parameter audioStreamIndex: (query) The audio stream index. (optional)
- parameter subtitleStreamIndex: (query) The subtitle stream index. (optional)
- parameter maxAudioChannels: (query) The maximum number of audio channels. (optional)
- parameter itemId: (query) The item id. (optional)
- parameter enableDirectPlay: (query) Whether to enable direct play. Default: true. (optional)
- parameter enableDirectStream: (query) Whether to enable direct stream. Default: true. (optional)
- parameter completion: completion handler to receive the data and the error objects
*/
open class func openLiveStream(body: LiveStreamsOpenBody? = nil, openToken: String? = nil, userId: UUID? = nil, playSessionId: String? = nil, maxStreamingBitrate: Int? = nil, startTimeTicks: Int64? = nil, audioStreamIndex: Int? = nil, subtitleStreamIndex: Int? = nil, maxAudioChannels: Int? = nil, itemId: UUID? = nil, enableDirectPlay: Bool? = nil, enableDirectStream: Bool? = nil, completion: @escaping ((_ data: LiveStreamResponse?,_ error: Error?) -> Void)) {
openLiveStreamWithRequestBuilder(body: body, openToken: openToken, userId: userId, playSessionId: playSessionId, maxStreamingBitrate: maxStreamingBitrate, startTimeTicks: startTimeTicks, audioStreamIndex: audioStreamIndex, subtitleStreamIndex: subtitleStreamIndex, maxAudioChannels: maxAudioChannels, itemId: itemId, enableDirectPlay: enableDirectPlay, enableDirectStream: enableDirectStream).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Opens a media source.
- POST /LiveStreams/Open
-
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- examples: [{contentType=application/json, example={
"MediaSource" : ""
}}]
- parameter body: (body) The open live stream dto. (optional)
- parameter openToken: (query) The open token. (optional)
- parameter userId: (query) The user id. (optional)
- parameter playSessionId: (query) The play session id. (optional)
- parameter maxStreamingBitrate: (query) The maximum streaming bitrate. (optional)
- parameter startTimeTicks: (query) The start time in ticks. (optional)
- parameter audioStreamIndex: (query) The audio stream index. (optional)
- parameter subtitleStreamIndex: (query) The subtitle stream index. (optional)
- parameter maxAudioChannels: (query) The maximum number of audio channels. (optional)
- parameter itemId: (query) The item id. (optional)
- parameter enableDirectPlay: (query) Whether to enable direct play. Default: true. (optional)
- parameter enableDirectStream: (query) Whether to enable direct stream. Default: true. (optional)
- returns: RequestBuilder<LiveStreamResponse>
*/
open class func openLiveStreamWithRequestBuilder(body: LiveStreamsOpenBody? = nil, openToken: String? = nil, userId: UUID? = nil, playSessionId: String? = nil, maxStreamingBitrate: Int? = nil, startTimeTicks: Int64? = nil, audioStreamIndex: Int? = nil, subtitleStreamIndex: Int? = nil, maxAudioChannels: Int? = nil, itemId: UUID? = nil, enableDirectPlay: Bool? = nil, enableDirectStream: Bool? = nil) -> RequestBuilder<LiveStreamResponse> {
let path = "/LiveStreams/Open"
let URLString = SwaggerClientAPI.basePath + path
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"openToken": openToken,
"userId": userId,
"playSessionId": playSessionId,
"maxStreamingBitrate": maxStreamingBitrate?.encodeToJSON(),
"startTimeTicks": startTimeTicks?.encodeToJSON(),
"audioStreamIndex": audioStreamIndex?.encodeToJSON(),
"subtitleStreamIndex": subtitleStreamIndex?.encodeToJSON(),
"maxAudioChannels": maxAudioChannels?.encodeToJSON(),
"itemId": itemId,
"enableDirectPlay": enableDirectPlay,
"enableDirectStream": enableDirectStream
])
let requestBuilder: RequestBuilder<LiveStreamResponse>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
}
}