export type Video3DFormat = 'HalfSideBySide' | 'FullSideBySide' | 'FullTopAndBottom' | 'HalfTopAndBottom' | 'MVC'; export type ExternalUrl = {Name?: (string | null) | undefined, Url?: (string | null) | undefined}; export type MediaProtocol = 'File' | 'Http' | 'Rtmp' | 'Rtsp' | 'Udp' | 'Rtp' | 'Ftp'; export type MediaSourceType = 'Default' | 'Grouping' | 'Placeholder'; export type VideoType = 'VideoFile' | 'Iso' | 'Dvd' | 'BluRay'; export type IsoType = 'Dvd' | 'BluRay'; export type MediaStreamType = 'Audio' | 'Video' | 'Subtitle' | 'EmbeddedImage'; export type SubtitleDeliveryMethod = 'Encode' | 'Embed' | 'External' | 'Hls'; export type MediaStream = {Codec?: (string | null) | undefined, CodecTag?: (string | null) | undefined, Language?: (string | null) | undefined, ColorRange?: (string | null) | undefined, ColorSpace?: (string | null) | undefined, ColorTransfer?: (string | null) | undefined, ColorPrimaries?: (string | null) | undefined, Comment?: (string | null) | undefined, TimeBase?: (string | null) | undefined, CodecTimeBase?: (string | null) | undefined, Title?: (string | null) | undefined, VideoRange?: (string | null) | undefined, localizedUndefined?: (string | null) | undefined, localizedDefault?: (string | null) | undefined, localizedForced?: (string | null) | undefined, DisplayTitle?: (string | null) | undefined, NalLengthSize?: (string | null) | undefined, IsInterlaced?: boolean | undefined, IsAVC?: (boolean | null) | undefined, ChannelLayout?: (string | null) | undefined, BitRate?: (number | null) | undefined, BitDepth?: (number | null) | undefined, RefFrames?: (number | null) | undefined, PacketLength?: (number | null) | undefined, Channels?: (number | null) | undefined, SampleRate?: (number | null) | undefined, IsDefault?: boolean | undefined, IsForced?: boolean | undefined, Height?: (number | null) | undefined, Width?: (number | null) | undefined, AverageFrameRate?: (number | null) | undefined, RealFrameRate?: (number | null) | undefined, Profile?: (string | null) | undefined, Type?: MediaStreamType | undefined, AspectRatio?: (string | null) | undefined, Index?: number | undefined, Score?: (number | null) | undefined, IsExternal?: boolean | undefined, DeliveryMethod?: SubtitleDeliveryMethod | undefined, DeliveryUrl?: (string | null) | undefined, IsExternalUrl?: (boolean | null) | undefined, IsTextSubtitleStream?: boolean | undefined, SupportsExternalStream?: boolean | undefined, Path?: (string | null) | undefined, PixelFormat?: (string | null) | undefined, Level?: (number | null) | undefined, IsAnamorphic?: (boolean | null) | undefined}; export type MediaAttachment = {Codec?: (string | null) | undefined, CodecTag?: (string | null) | undefined, Comment?: (string | null) | undefined, Index?: number | undefined, FileName?: (string | null) | undefined, MimeType?: (string | null) | undefined, DeliveryUrl?: (string | null) | undefined}; export type TransportStreamTimestamp = 'None' | 'Zero' | 'Valid'; export type MediaSourceInfo = {Protocol?: MediaProtocol | undefined, Id?: (string | null) | undefined, Path?: (string | null) | undefined, EncoderPath?: (string | null) | undefined, EncoderProtocol?: MediaProtocol | undefined, Type?: MediaSourceType | undefined, Container?: (string | null) | undefined, Size?: (number | null) | undefined, Name?: (string | null) | undefined, IsRemote?: boolean | undefined, ETag?: (string | null) | undefined, RunTimeTicks?: (number | null) | undefined, ReadAtNativeFramerate?: boolean | undefined, IgnoreDts?: boolean | undefined, IgnoreIndex?: boolean | undefined, GenPtsInput?: boolean | undefined, SupportsTranscoding?: boolean | undefined, SupportsDirectStream?: boolean | undefined, SupportsDirectPlay?: boolean | undefined, IsInfiniteStream?: boolean | undefined, RequiresOpening?: boolean | undefined, OpenToken?: (string | null) | undefined, RequiresClosing?: boolean | undefined, LiveStreamId?: (string | null) | undefined, BufferMs?: (number | null) | undefined, RequiresLooping?: boolean | undefined, SupportsProbing?: boolean | undefined, VideoType?: VideoType | undefined, IsoType?: IsoType | undefined, Video3DFormat?: Video3DFormat | undefined, MediaStreams?: (Array | null) | undefined, MediaAttachments?: (Array | null) | undefined, Formats?: (Array | null) | undefined, Bitrate?: (number | null) | undefined, Timestamp?: TransportStreamTimestamp | undefined, RequiredHttpHeaders?: ({[key: string]: string} | null) | undefined, TranscodingUrl?: (string | null) | undefined, TranscodingSubProtocol?: (string | null) | undefined, TranscodingContainer?: (string | null) | undefined, AnalyzeDurationMs?: (number | null) | undefined, DefaultAudioStreamIndex?: (number | null) | undefined, DefaultSubtitleStreamIndex?: (number | null) | undefined}; export type PlayAccess = 'Full' | 'None'; export type MediaUrl = {Url?: (string | null) | undefined, Name?: (string | null) | undefined}; export type BaseItemPerson = {Name?: (string | null) | undefined, Id?: (string | null) | undefined, Role?: (string | null) | undefined, Type?: (string | null) | undefined, PrimaryImageTag?: (string | null) | undefined, ImageBlurHashes?: ({Primary?: {[key: string]: string} | undefined, Art?: {[key: string]: string} | undefined, Backdrop?: {[key: string]: string} | undefined, Banner?: {[key: string]: string} | undefined, Logo?: {[key: string]: string} | undefined, Thumb?: {[key: string]: string} | undefined, Disc?: {[key: string]: string} | undefined, Box?: {[key: string]: string} | undefined, Screenshot?: {[key: string]: string} | undefined, Menu?: {[key: string]: string} | undefined, Chapter?: {[key: string]: string} | undefined, BoxRear?: {[key: string]: string} | undefined, Profile?: {[key: string]: string} | undefined} | null) | undefined}; export type NameGuidPair = {Name?: (string | null) | undefined, Id?: string | undefined}; export type UserItemDataDto = {Rating?: (number | null) | undefined, PlayedPercentage?: (number | null) | undefined, UnplayedItemCount?: (number | null) | undefined, PlaybackPositionTicks?: number | undefined, PlayCount?: number | undefined, IsFavorite?: boolean | undefined, Likes?: (boolean | null) | undefined, LastPlayedDate?: (string | null) | undefined, Played?: boolean | undefined, Key?: (string | null) | undefined, ItemId?: (string | null) | undefined}; export type DayOfWeek = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'; export type ChapterInfo = {StartPositionTicks?: number | undefined, Name?: (string | null) | undefined, ImagePath?: (string | null) | undefined, ImageDateModified?: string | undefined, ImageTag?: (string | null) | undefined}; export type LocationType = 'FileSystem' | 'Remote' | 'Virtual' | 'Offline'; export type MetadataField = 'Cast' | 'Genres' | 'ProductionLocations' | 'Studios' | 'Tags' | 'Name' | 'Overview' | 'Runtime' | 'OfficialRating'; export type ImageOrientation = 'TopLeft' | 'TopRight' | 'BottomRight' | 'BottomLeft' | 'LeftTop' | 'RightTop' | 'RightBottom' | 'LeftBottom'; export type ChannelType = 'TV' | 'Radio'; export type ProgramAudio = 'Mono' | 'Stereo' | 'Dolby' | 'DolbyDigital' | 'Thx' | 'Atmos'; export type BaseItemDto = {Name?: (string | null) | undefined, OriginalTitle?: (string | null) | undefined, ServerId?: (string | null) | undefined, Id?: string | undefined, Etag?: (string | null) | undefined, SourceType?: (string | null) | undefined, PlaylistItemId?: (string | null) | undefined, DateCreated?: (string | null) | undefined, DateLastMediaAdded?: (string | null) | undefined, ExtraType?: (string | null) | undefined, AirsBeforeSeasonNumber?: (number | null) | undefined, AirsAfterSeasonNumber?: (number | null) | undefined, AirsBeforeEpisodeNumber?: (number | null) | undefined, CanDelete?: (boolean | null) | undefined, CanDownload?: (boolean | null) | undefined, HasSubtitles?: (boolean | null) | undefined, PreferredMetadataLanguage?: (string | null) | undefined, PreferredMetadataCountryCode?: (string | null) | undefined, SupportsSync?: (boolean | null) | undefined, Container?: (string | null) | undefined, SortName?: (string | null) | undefined, ForcedSortName?: (string | null) | undefined, Video3DFormat?: Video3DFormat | undefined, PremiereDate?: (string | null) | undefined, ExternalUrls?: (Array | null) | undefined, MediaSources?: (Array | null) | undefined, CriticRating?: (number | null) | undefined, ProductionLocations?: (Array | null) | undefined, Path?: (string | null) | undefined, EnableMediaSourceDisplay?: (boolean | null) | undefined, OfficialRating?: (string | null) | undefined, CustomRating?: (string | null) | undefined, ChannelId?: (string | null) | undefined, ChannelName?: (string | null) | undefined, Overview?: (string | null) | undefined, Taglines?: (Array | null) | undefined, Genres?: (Array | null) | undefined, CommunityRating?: (number | null) | undefined, CumulativeRunTimeTicks?: (number | null) | undefined, RunTimeTicks?: (number | null) | undefined, PlayAccess?: PlayAccess | undefined, AspectRatio?: (string | null) | undefined, ProductionYear?: (number | null) | undefined, IsPlaceHolder?: (boolean | null) | undefined, Number?: (string | null) | undefined, ChannelNumber?: (string | null) | undefined, IndexNumber?: (number | null) | undefined, IndexNumberEnd?: (number | null) | undefined, ParentIndexNumber?: (number | null) | undefined, RemoteTrailers?: (Array | null) | undefined, ProviderIds?: ({[key: string]: string} | null) | undefined, IsHD?: (boolean | null) | undefined, IsFolder?: (boolean | null) | undefined, ParentId?: (string | null) | undefined, Type?: (string | null) | undefined, People?: (Array | null) | undefined, Studios?: (Array | null) | undefined, GenreItems?: (Array | null) | undefined, ParentLogoItemId?: (string | null) | undefined, ParentBackdropItemId?: (string | null) | undefined, ParentBackdropImageTags?: (Array | null) | undefined, LocalTrailerCount?: (number | null) | undefined, UserData?: UserItemDataDto | undefined, RecursiveItemCount?: (number | null) | undefined, ChildCount?: (number | null) | undefined, SeriesName?: (string | null) | undefined, SeriesId?: (string | null) | undefined, SeasonId?: (string | null) | undefined, SpecialFeatureCount?: (number | null) | undefined, DisplayPreferencesId?: (string | null) | undefined, Status?: (string | null) | undefined, AirTime?: (string | null) | undefined, AirDays?: (Array | null) | undefined, Tags?: (Array | null) | undefined, PrimaryImageAspectRatio?: (number | null) | undefined, Artists?: (Array | null) | undefined, ArtistItems?: (Array | null) | undefined, Album?: (string | null) | undefined, CollectionType?: (string | null) | undefined, DisplayOrder?: (string | null) | undefined, AlbumId?: (string | null) | undefined, AlbumPrimaryImageTag?: (string | null) | undefined, SeriesPrimaryImageTag?: (string | null) | undefined, AlbumArtist?: (string | null) | undefined, AlbumArtists?: (Array | null) | undefined, SeasonName?: (string | null) | undefined, MediaStreams?: (Array | null) | undefined, VideoType?: VideoType | undefined, PartCount?: (number | null) | undefined, MediaSourceCount?: (number | null) | undefined, ImageTags?: ({[key: string]: string} | null) | undefined, BackdropImageTags?: (Array | null) | undefined, ScreenshotImageTags?: (Array | null) | undefined, ParentLogoImageTag?: (string | null) | undefined, ParentArtItemId?: (string | null) | undefined, ParentArtImageTag?: (string | null) | undefined, SeriesThumbImageTag?: (string | null) | undefined, ImageBlurHashes?: ({Primary?: {[key: string]: string} | undefined, Art?: {[key: string]: string} | undefined, Backdrop?: {[key: string]: string} | undefined, Banner?: {[key: string]: string} | undefined, Logo?: {[key: string]: string} | undefined, Thumb?: {[key: string]: string} | undefined, Disc?: {[key: string]: string} | undefined, Box?: {[key: string]: string} | undefined, Screenshot?: {[key: string]: string} | undefined, Menu?: {[key: string]: string} | undefined, Chapter?: {[key: string]: string} | undefined, BoxRear?: {[key: string]: string} | undefined, Profile?: {[key: string]: string} | undefined} | null) | undefined, SeriesStudio?: (string | null) | undefined, ParentThumbItemId?: (string | null) | undefined, ParentThumbImageTag?: (string | null) | undefined, ParentPrimaryImageItemId?: (string | null) | undefined, ParentPrimaryImageTag?: (string | null) | undefined, Chapters?: (Array | null) | undefined, LocationType?: LocationType | undefined, IsoType?: IsoType | undefined, MediaType?: (string | null) | undefined, EndDate?: (string | null) | undefined, LockedFields?: (Array | null) | undefined, TrailerCount?: (number | null) | undefined, MovieCount?: (number | null) | undefined, SeriesCount?: (number | null) | undefined, ProgramCount?: (number | null) | undefined, EpisodeCount?: (number | null) | undefined, SongCount?: (number | null) | undefined, AlbumCount?: (number | null) | undefined, ArtistCount?: (number | null) | undefined, MusicVideoCount?: (number | null) | undefined, LockData?: (boolean | null) | undefined, Width?: (number | null) | undefined, Height?: (number | null) | undefined, CameraMake?: (string | null) | undefined, CameraModel?: (string | null) | undefined, Software?: (string | null) | undefined, ExposureTime?: (number | null) | undefined, FocalLength?: (number | null) | undefined, ImageOrientation?: ImageOrientation | undefined, Aperture?: (number | null) | undefined, ShutterSpeed?: (number | null) | undefined, Latitude?: (number | null) | undefined, Longitude?: (number | null) | undefined, Altitude?: (number | null) | undefined, IsoSpeedRating?: (number | null) | undefined, SeriesTimerId?: (string | null) | undefined, ProgramId?: (string | null) | undefined, ChannelPrimaryImageTag?: (string | null) | undefined, StartDate?: (string | null) | undefined, CompletionPercentage?: (number | null) | undefined, IsRepeat?: (boolean | null) | undefined, EpisodeTitle?: (string | null) | undefined, ChannelType?: ChannelType | undefined, Audio?: ProgramAudio | undefined, IsMovie?: (boolean | null) | undefined, IsSports?: (boolean | null) | undefined, IsSeries?: (boolean | null) | undefined, IsLive?: (boolean | null) | undefined, IsNews?: (boolean | null) | undefined, IsKids?: (boolean | null) | undefined, IsPremiere?: (boolean | null) | undefined, TimerId?: (string | null) | undefined, CurrentProgram?: BaseItemDto | undefined}; export type QueueItem = {Id?: string | undefined, PlaylistItemId?: (string | null) | undefined}; export type PlaybackStopInfo = {Item?: BaseItemDto | undefined, ItemId?: string | undefined, SessionId?: (string | null) | undefined, MediaSourceId?: (string | null) | undefined, PositionTicks?: (number | null) | undefined, LiveStreamId?: (string | null) | undefined, PlaySessionId?: (string | null) | undefined, Failed?: boolean | undefined, NextMediaType?: (string | null) | undefined, PlaylistItemId?: (string | null) | undefined, NowPlayingQueue?: (Array | null) | undefined}; export type CreateApiSessionsPlayingStoppedArgs = {body: PlaybackStopInfo}; export type CreateApiSessionsPlayingStoppedOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reports playback has stopped within a session. * * POST /Sessions/Playing/Stopped */ export const createApiSessionsPlayingStopped = async (args: CreateApiSessionsPlayingStoppedArgs, options?: CreateApiSessionsPlayingStoppedOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/Sessions/Playing/Stopped${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };