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

Merge pull request #4761 from dmitrylyzo/hls-direct-play

This commit is contained in:
Bill Thornton 2023-09-14 15:48:07 -04:00 committed by GitHub
commit 9435e3172d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 7 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';
}