diff --git a/frontend/src/utils/cards/RecordingCardUtils.js b/frontend/src/utils/cards/RecordingCardUtils.js index 4920c8ba..60d527bd 100644 --- a/frontend/src/utils/cards/RecordingCardUtils.js +++ b/frontend/src/utils/cards/RecordingCardUtils.js @@ -2,6 +2,7 @@ import API from '../../api.js'; import useChannelsStore from '../../store/channels.jsx'; import defaultLogo from '../../images/logo.png'; import { formatSeasonEpisode } from '../guideUtils.js'; +import { buildLiveStreamUrl } from '../components/FloatingVideoUtils.js'; export const removeRecording = (id) => { // Optimistically remove immediately from UI @@ -63,7 +64,7 @@ export const getShowVideoUrl = (channel, env_mode) => { if (env_mode === 'dev') { url = `${window.location.protocol}//${window.location.hostname}:5656${url}`; } - return url; + return buildLiveStreamUrl(url); }; export const runComSkip = async (recording) => { diff --git a/frontend/src/utils/cards/__tests__/RecordingCardUtils.test.js b/frontend/src/utils/cards/__tests__/RecordingCardUtils.test.js index 2af98a1c..2e601120 100644 --- a/frontend/src/utils/cards/__tests__/RecordingCardUtils.test.js +++ b/frontend/src/utils/cards/__tests__/RecordingCardUtils.test.js @@ -19,6 +19,7 @@ vi.mock('../../../store/channels'); describe('RecordingCardUtils', () => { beforeEach(() => { vi.clearAllMocks(); + localStorage.clear(); }); describe('removeRecording', () => { @@ -147,19 +148,32 @@ describe('RecordingCardUtils', () => { }); describe('getShowVideoUrl', () => { - it('returns proxy URL for channel', () => { + it('returns proxy URL with mpegts output format for channel', () => { const channel = { uuid: 'channel-123' }; const result = getShowVideoUrl(channel, 'production'); - expect(result).toBe('/proxy/ts/stream/channel-123'); + expect(result).toBe('/proxy/ts/stream/channel-123?output_format=mpegts'); }); - it('prepends dev server URL in dev mode', () => { + it('includes output_profile when set in player prefs', () => { + localStorage.setItem( + 'dispatcharr-player-prefs', + JSON.stringify({ webPlayerOutputProfileId: 5 }) + ); + const channel = { uuid: 'channel-123' }; + const result = getShowVideoUrl(channel, 'production'); + + expect(result).toBe( + '/proxy/ts/stream/channel-123?output_format=mpegts&output_profile=5' + ); + }); + + it('prepends dev server URL in dev mode with output params', () => { const channel = { uuid: 'channel-123' }; const result = getShowVideoUrl(channel, 'dev'); expect(result).toMatch( - /^https?:\/\/.*:5656\/proxy\/ts\/stream\/channel-123$/ + /^https?:\/\/.*:5656\/proxy\/ts\/stream\/channel-123\?output_format=mpegts$/ ); }); });