mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Merge pull request #1305 from nemesbak:fix/output-profile-guide-player
fix(frontend): apply web-player output profile in TV Guide and all live stream calls
This commit is contained in:
commit
87accc2f63
2 changed files with 20 additions and 5 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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$/
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue