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

12 lines
458 B
TypeScript
Raw Normal View History

2023-09-14 00:14:10 +03:00
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 {
const protocol = mediaSource?.TranscodingSubProtocol || mediaSource?.Container;
return protocol?.toUpperCase() === 'HLS';
2023-09-14 00:14:10 +03:00
}