1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Extract HLS stream test function

This commit is contained in:
Dmitry Lyzo 2023-09-14 00:14:10 +03:00
parent b2c7d93498
commit 1684acd0ca
2 changed files with 14 additions and 5 deletions

10
src/utils/mediaSource.ts Normal file
View file

@ -0,0 +1,10 @@
import type { MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client';
/**
* Checks if the media source is an HLS stream.
* @param mediaSource The media source.
* @returns _true_ if the media source is an HLS stream, _false_ otherwise.
*/
export function isHls(mediaSource: MediaSourceInfo|null|undefined): boolean {
return (mediaSource?.TranscodingSubProtocol || mediaSource?.Container) === 'hls';
}