mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +00:00
fix: isHLSRequest
-> isHlsRequest
This commit is contained in:
parent
87a6428dde
commit
21e224bd14
@ -38,7 +38,7 @@ function transformMediaPlaylist(streamInfo, hlsPlaylist) {
|
|||||||
|
|
||||||
const HLS_MIME_TYPES = ["application/vnd.apple.mpegurl", "audio/mpegurl", "application/x-mpegURL"];
|
const HLS_MIME_TYPES = ["application/vnd.apple.mpegurl", "audio/mpegurl", "application/x-mpegURL"];
|
||||||
|
|
||||||
export function isHLSRequest (req) {
|
export function isHlsRequest (req) {
|
||||||
return HLS_MIME_TYPES.includes(req.headers['content-type']);
|
return HLS_MIME_TYPES.includes(req.headers['content-type']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { request } from 'undici';
|
|||||||
import { Readable } from 'node:stream';
|
import { Readable } from 'node:stream';
|
||||||
import { assert } from 'console';
|
import { assert } from 'console';
|
||||||
import { getHeaders } from './shared.js';
|
import { getHeaders } from './shared.js';
|
||||||
import { handleHlsPlaylist, isHLSRequest } from './internal-hls.js';
|
import { handleHlsPlaylist, isHlsRequest } from './internal-hls.js';
|
||||||
|
|
||||||
const CHUNK_SIZE = BigInt(8e6); // 8 MB
|
const CHUNK_SIZE = BigInt(8e6); // 8 MB
|
||||||
const min = (a, b) => a < b ? a : b;
|
const min = (a, b) => a < b ? a : b;
|
||||||
@ -98,7 +98,7 @@ export async function internalStream(streamInfo, res) {
|
|||||||
if (req.statusCode < 200 || req.statusCode > 299)
|
if (req.statusCode < 200 || req.statusCode > 299)
|
||||||
return res.end();
|
return res.end();
|
||||||
|
|
||||||
if (isHLSRequest(req)) {
|
if (isHlsRequest(req)) {
|
||||||
await handleHlsPlaylist(streamInfo, req, res);
|
await handleHlsPlaylist(streamInfo, req, res);
|
||||||
} else {
|
} else {
|
||||||
req.body.pipe(res);
|
req.body.pipe(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user