export type GetApiLiveTvLiveRecordingsRecordingIdStreamArgs = {recordingId: string}; export type GetApiLiveTvLiveRecordingsRecordingIdStreamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets a live tv recording stream. * * GET /LiveTv/LiveRecordings/{recordingId}/stream */ export const getApiLiveTvLiveRecordingsRecordingIdStream = async (args: GetApiLiveTvLiveRecordingsRecordingIdStreamArgs, options?: GetApiLiveTvLiveRecordingsRecordingIdStreamOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "video/*") const url = `${baseUrl.replace(/\/+$/, '')}/LiveTv/LiveRecordings/${encodeURIComponent(String(args.recordingId))}/stream${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };