mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix HLS stream check
The TranscodingSubProtocol is no longer nullable on the server side and direct playing media will have a value of http. Check container type when TranscodingSubProtocol is not HLS
This commit is contained in:
parent
20e29b81b5
commit
adcea4467d
1 changed files with 5 additions and 2 deletions
|
@ -6,6 +6,9 @@ import type { MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client';
|
||||||
* @returns _true_ if the media source is an HLS stream, _false_ otherwise.
|
* @returns _true_ if the media source is an HLS stream, _false_ otherwise.
|
||||||
*/
|
*/
|
||||||
export function isHls(mediaSource: MediaSourceInfo|null|undefined): boolean {
|
export function isHls(mediaSource: MediaSourceInfo|null|undefined): boolean {
|
||||||
const protocol = mediaSource?.TranscodingSubProtocol || mediaSource?.Container;
|
if (mediaSource?.TranscodingSubProtocol?.toUpperCase() === 'HLS') {
|
||||||
return protocol?.toUpperCase() === 'HLS';
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mediaSource?.Container?.toUpperCase() === 'HLS';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue